JS TutorialLesson #288
jQuery CSS Styles
[jQuery](/jquery/default.asp) was created in 2006 by John Resig. It was designed to handle Browser Incompatibilities and to simplify HTML DOM Manipulation, Event Handling, Anima...
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:
Share
Hiding HTML Elements
Hide an HTML Element:
jQuery
Example Code
javascriptmyElement.hide();JavaScript
Example Code
javascriptmyElement.style.display = "none";Showing HTML Elements
Show an HTML Element:
jQuery
Example Code
javascriptmyElement.show();JavaScript
Example Code
javascriptmyElement.style.display = "";Styling HTML Elements
Change the font size of an HTML element:
jQuery
Example Code
javascript$("#demo").css("font-size","35px");JavaScript
Example Code
javascriptdocument.getElementById("demo").style.fontSize = "35px";Interactive Code Examples
JavaScript
javascriptJavaScript syntax and algorithm demonstration.
myElement.style.display = "none";JavaScript
javascriptJavaScript syntax and algorithm demonstration.
myElement.style.display = "";jQuery
javascriptJavaScript syntax and algorithm demonstration.
$("#demo").css("font-size","35px");JavaScript
javascriptInteractive runnable JavaScript example from EA Academy.
Live Output Preview: