MANIPULATE HTML ELEMENTS VIA THE DOM
You can manipulate and change HTML elements found in the DOM with jQuery. This enables you to dynamically change the original HTML tags and attributes rendered in the web browser after the web page actually loads.
The HTML content within selected elements can be modified using the html() method. Or you can inject new HTML content before HTML elements using before() and after using after() . In all three cases, you can specify the new HTML code as a parameter to the method.
You can also edit the selected HTML elements by adding or changing individuat attributes. Use attr() to get or set vatues or removeAttr() to remove an attribute.
Finally, you can remove selected HTML elements using detach() . This will purge ...
Get HTML5: Your visual blueprint™ for designing rich web pages and applications now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.