<html>
<head>
</head>
<body>
<input id="fname" name="" value="hi" type="text"/>
</body>
</html>
jQuery.fn.exists = function(){return this.length>0;}
Example
if ($('#fname').exists()) {
alert('Yes Its There');
}else{
alert('No Its NOT There');
}
<head>
</head>
<body>
<input id="fname" name="" value="hi" type="text"/>
</body>
</html>
jQuery.fn.exists = function(){return this.length>0;}
Example
if ($('#fname').exists()) {
alert('Yes Its There');
}else{
alert('No Its NOT There');
}
No comments:
Post a Comment