
See Our team
Wondering how we keep quality?
Got unsolved questions? Ask Questions
GATE
GMAT
CBSE
NCERT
Career
Interview
Railway
UPSC
NID
NIFT-UG
NIFT-PG
PHP
AJAX
JavaScript
Node Js
Shell Script
Research
How we use JavaScript with HTML?
explain in HTML
The
<script>
tag is used to define a client-side script (JavaScript).The
<script>
element either contains script statements, or it points to an external script file through thesrc
attribute.Common uses for JavaScript are image manipulation, form validation, and dynamic changes of content.
To select an HTML element, JavaScript most often uses the
document.getElementById()
method.This JavaScript example writes "Hello JavaScript!" into an HTML element with id="demo":
example :
<script>
document.getElementById("demo").innerHTML = "Hello JavaScript!";
</script>
A Taste of JavaScript
Here are some examples of what JavaScript can do:
1)
JavaScript can change HTML content
document.getElementById("demo").innerHTML = "Hello JavaScript!";
2)
JavaScript can change HTML styles
document.getElementById("demo").style.fontSize = "25px";
document.getElementById("demo").style.color = "red";
document.getElementById("demo").style.backgroundColor = "yellow";
3)
JavaScript can change HTML attributes
document.getElementById("image").src = "picture.gif";
You might like this video:Network and IP Address Watch more here
Watch more videos from this user Here
Learn how to upload a video over here
You might like this video:Network and IP Address Watch more here
Watch more videos from this user Here
Learn how to upload a video over here
We made eduladder by keeping the ideology of building a supermarket of all the educational material available under one roof. We are doing it with the help of individual contributors like you, interns and employees. So the resources you are looking for can be easily available and accessible also with the freedom of remix reuse and reshare our content under the terms of creative commons license with attribution required close.
You can also contribute to our vision of "Helping student to pass any exams" with these. Answer a question: You can answer the questions not yet answered in eduladder.How to answer a question Career: Work or do your internship with us.Work with us Create a video: You can teach anything and everything each video should be less than five minutes should cover the idea less than five min.How to upload a video on eduladder