4th Street Bar Hive-Bar

Hive-Bar Powered by Hive beta-fdb5b5b

Community post

判断对象是否为空 js与Jquery区别

  1. js
    if(document.getElementById('id')==null)

2 Jqurey

     if($('#id').length==0)

     注意:不可用('#id')==null('#id')==null判断,因为('#id')总是返回JQuery对象
1 upvotes $0.00

Replies (2)

Review before signing

Posting as . Signing with . Keychain permission: Posting. Hive Keychain will ask you to approve this action next.


  
Technical details

Operation fingerprint: