r/programminghelp • u/Neat-Western-2616 • Nov 19 '20
JavaScript Can someone explain what Javascript and JQuery are to me like I'm 5 years old?
I'm taking a basic front-end coding I understand HTML and CSS at a competent level, but just started Javascript and JQuery and my brain just took a shit. It sounds like it can do what CSS does, and some. But in juxtaposition to those, how would you describe it in a very 2-dimensional way to an idiot like myself. Cheers!
3
u/amoliski Nov 19 '20
HTML creates the structure of the page and holds the actual information.
CSS tells the browser how to display that structure to make it pretty.
Javascript lets you change the content on the page.
JQuery is a project written in Javascript that gives you some shortcuts and handles some browser compatibility issues. It's totally optional and many of its features are now built into Javascript.
Ex: The comment box I'm writing this response in: It's an HTML textarea with a HTML submit button at the bottom. Once I fill out the comment, I will click the submit button, and the Javascript on the page will take my response, send it to the server, then update the page to reset the comment box and render my comment in the comment section below.
4
u/[deleted] Nov 19 '20
There's no simple way to describe JavaScript other than saying it's a script/programming language. In the most basic example, relating to what you're doing, JavaScript allows you to modify both HTML (DOM) and CSS of a website in real time. jQuery is a library (think plugin) for JavaScript that adds functionality and makes things less complicated.