Javascript Help

Question:


I’ve recently gotten into HTML and CSS and have had some success with it. I am thinking now to get into Javascript but I don’t understand how to integrate it into websites. Here’s my thinking about HTML and CSS (obviously I might not be right). So HTML, for me, is using tags and constructing the foundation. CSS is assigning properties to the HTML to make it look a certain way and/or position it. If it would be possible, would someone be able to explain to me how Javascript connects with HTML, CSS, or both.

Thanks.

1 Like

I’d recommend this JS tutorial: JavaScript Tutorial.

JavaScript is for programming the behavior of web pages. It can create HTML elements, edit its attributes and styling, detect clicks, just to name a few.

1 Like

Alright, thanks. I’ll check out the tutorial.

3 Likes

You’re absolutely right, HTML sets up the structure or layout of the physical elements of the page, CSS just makes the page look good. What JavaScript does is it makes the page actually work. JavaScript can interact with HTML elements and can style them using CSS, but it can also edit them like HTML and it can do much more. You can create a page with HTML and CSS, but it probably isn’t functional without a little JavaScript, and even if it is, JavaScript could make it better.

1 Like

js cant really do much for a website untill you learn it and understand how to change/create elements with to link a js file it’s :

<script src="filename.js"></script>

edit:
js is basically code that runs in the background and i was wrong you don’t really need to know how to edit or create elements, js can also be used to validate forms but you will need to know how to grab elements

1 Like