I\'m using jQuery and I want to check the existence of an element in my page. I have written following code, but it\'s not working:
if($(\"#btext\" + i) != n
Using the length property you can do this.
jQuery.fn.exists = function(){return ($(this).length < 0);} if ($(selector).exists()) { //do somthing }