```
    function validate() {
        var x=document.getElementById("user").value;
        var y=document.getElementById("pass").value;
        if(x==null || x==" ") {
            alert("Enter username");
        }
        if(y==null || y==" ") {
            alert("Enter password");
        }
    }

```