jQuery get DOM element as string

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

Say I have

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

How do I get



        
5条回答
  •  情歌与酒
    2020-12-30 03:49

    How about:

    var str = $(selector)[0]
    

    Maybe add a check that there is one element returned.

提交回复
热议问题