Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<title>JS Bin</title>
</head>
<body>
  <div>
            <form id="inputForm" >
                <label for="userInput">Input : </label>
                <span id="userInputSpan">
                    <input type="text" id="userInput" onkeydown="readInput(this)"/>
                </span>
            </form>
        </div>
</body>
</html>
  
 
window.onload = function() {
  document.getElementById("userInput").focus();
};
function readInput(e){
    if ( e.keyCode == 13 ) { 
        // var temp = e.value;
        // console.log(temp);
        alert(e.value);
    }
}
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers