Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
  <form>
      <input type="text" id="user1">
      <div id="error"></div>
      <button onClick="test();return false;">Work</button>
    </form>
</body>
</html>
 
function test(){
        var userdata = document.getElementById("user1").value;
        if(userdata === ""){
          document.getElementById("error").innerHTML="Please fill in Blanks";
        } else{
          document.getElementById("error").innerHTML="";
        }
      }
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers