How to get nodeType using jquery

前端 未结 5 1398
借酒劲吻你
借酒劲吻你 2021-01-13 02:52

I want to get nodeType and then compare it to where it is text node or element node.





        
5条回答
  •  星月不相逢
    2021-01-13 03:44

    I know it wasn't the question, but to see what type it is (DIV, SPAN, etc), use tagName.

    var mm = $('.jj').get(0);
    alert(mm.tagName);
    

提交回复
热议问题