How to manipulate HTML within a jQuery variable?

前端 未结 2 1795
小鲜肉
小鲜肉 2021-01-17 15:14

I am trying to manipulate the HTML stored within a jQuery variable. I want to do this manipulation before I write the variable to the document.

So, I have a variable

2条回答
  •  别那么骄傲
    2021-01-17 15:33

    Try this:

    var sighting = "
    ", $elem = $(sighting).find("span.feed_name").text("hello world").parent(); $("#sightings").append($elem);

    The parent call is needed to get back to the outer div.

提交回复
热议问题