Jump to content

html java script


Mario Margjini

Recommended Posts

Hey there,

Welcome to the forum!

HTML and JavaScript are about as different as a potato and a knife.

HTML are the building blocks of most web pages (Unsure if there is one that isn't), and uses CSS to style the HTML into a pleasing format.

JavaScript in its most basic form creates interactivity and flexibility with HTML and CSS. 

 

Yeah so HTML is your structure, CSS is your design, and JS makes it work. Query data, move objects around the page, change CSS, change HTML.

 

Have a look at the JavaScript tutorial for more information surrounding it! https://www.w3schools.com/js/

JS HTML DOM tutorial will show you more about the interactivity, and how JS can meld your HTML. https://www.w3schools.com/js/js_htmldom.asp

Link to comment
Share on other sites

13 hours ago, dsonesuk said:

Potato and knife? Banana and fork? Apple and spoon? Or maybe chalk and cheese. 😁

I was trying to be somewhat clever, but I thought a potato and a peeler was too on the nose. Haha

Link to comment
Share on other sites

  • 3 weeks later...

Hello,
JavaScript can be used to change the HTML content as well as mostly used for the validations of the input types. you can apply JavaScript in two ways. Either internal or externally.
When you write your JS code in between <script>, then it is called Internal JavaScript.
E.x.

<script> 
function myFunction() {
 document.getElementById("demo").innerHTML = "Paragraph changed.";
}
</script>


When you write your JS code in a separate file and then give its path to src attribute in <script>, then it is called External JavaScript.
E.x.
Your Js File:
 

function myFunction() {
 document.getElementById("demo").innerHTML = "Paragraph changed.";
}
<script src="script.js"></script>

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...