<! DOCTYPE html>//The DOM object adds a text to the element div id= "Hello" and then changes the font to redWindow.onload =function(){ //gets the element div with ID imooc1 varA = document.getElementById ("Hello"); //change the value in a DIV elementA.innerhtml= "This is the best way."; //Change StyleA.style.color= "Red"; } //Add a text to the element div id= "World" with a jquery object, then change the font to Pink$ (document). Ready (function(){ //Get an element with ID imooc2 with jquery syntax get a jquery object var$a = $ ("#world"); //call the object's HTML () method to make changes to the content, call the object's CSS () method to change the color, font style$a. HTML ("This is a good start!")). css ({color:"Pink", FontSize:"50px" }); }); </script>This code will help you distinguish between two types of objects, with detailed explanations in the code!!!
Comparison of JavaScript DOM objects and jquery objects