I'm using jQuery and I want to check the existence of an element in my page.
(我正在使用jQuery,我想检查页面中是否存在元素。)
I have written following code, but it's not working:(我写了下面的代码,但它不起作用:)
if($("#btext" + i) != null) {
//alert($("#btext" + i).text());
$("#btext" + i).text("Branch " + i);
}
How do I check the existence of the element?
(如何检查元素的存在?)
ask by Prashant translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…