开发者

how to check whether the span element present or not

开发者_如何转开发I want to know the method to check if there is span element present or not.. if so that element should remove and add new span element... if there is no span element, then add the span element now... not only for span tell me the method which is applicable to all the situations or elements

Thank you


if($('#id').length) // tells you whether it exists or not

based on you can write your logic

if ($('#my-element').length) {
     // #my-element exists
}

use jquery's .remove()//or .hide()
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜