HTML JavaScript

in javascripts •  7 years ago 

HTML JavaScript
JavaScript makes HTML pages more Dynamic and interactive.

unnamed.png
source

The HTML script Tag
The script tag is used to define a client side script (JavaScripts).

The script element either contains scripting statements, or it point to an external script file through the src attributes.

Common uses for JavaScripts are image manipulation, form validation, and dynamic change of content.

To Select an HTML element, JavaScript very often use the document.getElementById() method.

This JavaScript example write "Hello JavaScript!" into an HTML element with id="test":

example
script
document.getElementById("test").innerHTML = "Hello JavaScript!";

Tip: You can learn much more about JavaScript in our JavaScript Tutorial.

A taste of JavaScripts
Here are some examples of what JavaScript can do:

JavaScript can change HTML content
document.getElementById("test").innerHTML = "Hello JavaScript!";
JavaScript can change HTML styles
document.getElementById("test").style.fontSize = "25px";
document.getElementById("test").style.color = "red";
document.getElementById("test").style.backgroundColor = "yellow";
JavaScript can change HTML attributes
document.getElementById("image").src = "picture.gif";

The HTML noscript Tag
The noscript tag is used to provide an alternate content for users that have disabled scripts in their browser or have a browser that doesn't support client-side scripts:

example
script
document.getElementById("test").innerHTML = "Hello JavaScripts !";

noscript Sorry, your browser does not support JavaScripts !
HTML Script Tags
Tag Description
script defines a client-side scripts
noscript Defines an alternate content for user that do not supports client-side script

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

This post has received a 0.48 % upvote from @drotto thanks to: @rabiul21.