jQuery get DOM element as string

前端 未结 5 2106
走了就别回头了
走了就别回头了 2020-12-30 03:16

Say I have

$(\":input[type=text]:first\")

How do I get



        
5条回答
  •  旧巷少年郎
    2020-12-30 03:52

    Use jQuery.html() by appending to a created element.

    $('
    ').append($(":input[type=text]:first").clone()).html()

    Here is a fiddle providing an example: http://jsfiddle.net/Zwbmx/1/

提交回复
热议问题