How to get nodeType using jquery

前端 未结 5 1444
借酒劲吻你
借酒劲吻你 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:58

    try to access to those properties with

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

提交回复
热议问题