i have small function that running on condintion, if text box value is not equal to "jitender"then alert will come up, but i also want reset the text box value if text box value is not equal to "jitender".
$(function(){
$('button').click(function(){
var name= $('#name').val();
if(name!='jitender'){
alert("not valid name")
}
});
});
<input type="text" id="name"/>
<button>click me</button>