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
no matter what you selection is the function $() always returns a jQuery object so that cant be used to test. The best way yet (if not the only) is to use the size() function or the native length property as explained above.
$()
size()
if ( $('selector').size() ) {...}