JavaScript / jQuery HTML DOM

JavaScript is the world's most popular programming language.
JavaScript is the programming language of the Web.
JavaScript is easy to learn.
This tutorial will teach you JavaScript from basic to advanced.
Post Reply
Guest

JavaScript / jQuery HTML DOM

Post by Guest »

JavaScript / jQuery HTML DOM


jQuery vs JavaScript
jQuery was created in 2006 by John Resig.
It was designed to handle Browser Incompatibilities and to simplify HTML DOM Manipulation, Event Handling, Animations, and Ajax.
For more than 10 years, jQuery has been the most popular JavaScript library in the world.
However, after JavaScript Version 5 (2009), most of the jQuery utilities can be solved with a few lines of standard JavaScript:

Removing HTML Elements
Remove an HTML element:

jQuery

$("#id02").remove();


Try it Yourself »



JavaScript

document.getElementById("id02").remove();


Try it Yourself »



Get Parent Element
Return the parent of an HTML element:

jQuery

myParent = $("#02").parent().prop("nodeName"); ;


Try it Yourself »



JavaScript

myParent = document.getElementById("02").parentNode.nodeName;


Try it Yourself »















+1

Reference: https://www.w3schools.com/js/js_jquery_dom.asp
Post Reply