Skip to content
A tiny outerHTML shim for jQuery
JavaScript
Find file
Latest commit cc6166c Eric Elliott Update jquery.outerhtml.js
Failed to load latest commit information.
jquery.outerhtml.js Update jquery.outerhtml.js
readme.md Fixed docs

readme.md

jQuery.outerHTML

Just like .html(), except that it lets you get the HTML of the target element, including the element itself.

Like .html(), you can replace the whole element by passing a value in.

Get

var markup = $('#myElement').outerHTML();

Set

$('#myElement').outerHTML('<div><p>New Stuff!</p></div>');

Something went wrong with that request. Please try again.