Insert or alter content to element

// Insert content $("#theID").html("New content"); // Remove content $("#theID").empty(); // Insert content after the content currently in the element $("#theID").append("New content"); // Insert content before the content currently in the element $("#theID").prepend("New content"); // Insert content before the selected element $("#theID").before("New content"); // Insert content after the selected element $("#theID").after("New content"); // Wrap each span that are inside a div $("div span").wrap('<div class="className"/>'); // Wrap all spans that are inside a div $("div span").wrapAll('<div class="className"/>');

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.