How do you convert a jQuery object into a string?

前端 未结 12 2030
臣服心动
臣服心动 2020-11-22 15:07

How do you convert a jQuery object into a string?

12条回答
  •  感情败类
    2020-11-22 15:27

    Can you be a little more specific? If you're trying to get the HTML inside of a tag you can do something like this:

    HTML snippet:

    This is some text

    jQuery:

    var txt = $('p').html(); // Value of text is This is some text
    

提交回复
热议问题