Javascript examples for jQuery:Array
Return "True" on Empty jQuery Selector Array
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <script type="text/javascript"> $(function(){// w w w .j av a2s. c om $.extend($.expr[':'],{ present: function(a) { return $(a).length; } }); console.log($('#lnk').is(':present')); console.log($('#notLnk').is(':present')); }); </script> </head> <body> <a id="lnk">Link</a> </body> </html>