Check for empty text boxes

by ChrisStanyon

HTML

<input type="text" id="textbox1" />
<input type="text" id="textbox2" />
<button id="btnChangePassword">Click Me</button>

JavaScript

$('#btnChangePassword').click(function() {
    if ($('#textbox1').val() == '' || $('#textbox2').val() == '') {
        alert("We have missing info");   
    } else {
        alert("All present and correct");
    }    
});