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 defined as:

var sighting = "<div><span class="feed_name"></span></div>";

And I want to put "hello world" in the span element. This is the part that I can't get to work:

$(sighting).("span.feed_name").html(name);

Then I write the 'sighting' variable to the page:

$(#sightings).append(sighting);

Which puts the HTML in the sighting variable into the <div id="sightings"></div> element on the page.

Any help would be greatly appreciated!

Thanks,

Mark

Edit
Report