I know how to use .html() to grab the html inside of my selected element, like so:
<div id="outside>
<span>hello</span>
</div>
using something like
var span = $('#outside).html();
will grab my span as the html. My problem is when I have
<img id="image" src="image.png">
How can I assign the html, as a string, to a variable? Using
var image = $('#image').html()
gives me an empty string.
var image = $('#image')[0]
appears to get the html I want, but its actually still an object.