How to get a DOM Element from a JQuery Selector

前端 未结 4 886
不思量自难忘°
不思量自难忘° 2020-11-22 13:26

I\'m having an impossibly hard time finding out to get the actual DOMElement from a jquery selector. Sample Code:



        
4条回答
  •  孤街浪徒
    2020-11-22 13:30

    I needed to get the element as a string.

    jQuery("#bob").get(0).outerHTML;
    

    Which will give you something like:

    
    

    ...as a string rather than a DOM element.

提交回复
热议问题