JavaScript / jQuery HTML Elements


jQuery vs JavaScript

In 2006, John Resig made jQuery to fix browser issues and make working with HTML easier. jQuery helps with managing HTML elements, handling events, creating animations, and using Ajax. You can learn more about it at the link: jQuery.

jQuery has been the most widely used JavaScript library globally for over 10 years.

But since JavaScript Version 5 (2009), you can accomplish many jQuery tasks using just a few lines of regular JavaScript code.


Set Text Content

Change the text inside an HTML element:


Get Text Content

Retrieve the text inside an HTML element:


Set HTML Content

Update the text inside an HTML element:


Get HTML Content

Retrieve the HTML content from an element: