How to check null objects in jQuery
        Posted  
        
            by Prashant
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Prashant
        
        
        
        Published on 2009-01-25T13:08:40Z
        Indexed on 
            2010/03/24
            4:13 UTC
        
        
        Read the original article
        Hit count: 333
        
I am using jQuery, I want to check existence of an element in my page. I have done following code, but its not working?
if ($("#btext" + i) != null){
        //alert($("#btext" + i).text());
    $("#btext" + i).text("Branch " + i);
}
Please tell me what will be the right code?
Thanks
© Stack Overflow or respective owner