2 min read · Free · No login needed
JavaScript is the programming language of the web. HTML builds the page, CSS styles it, and JavaScript makes it do things: respond to clicks, check a form before it is sent, show and hide content, load new data without refreshing the page.
Write it inside a <script> tag, usually just before the closing </body> so the page content loads first. Or keep it in a separate .js file and link it: <script src="app.js"></script>. The separate-file way is better for real sites — one script file can serve every page.
document.getElementById("demo").innerHTML = "Hello!"; replaces the text inside an element.element.style.color = "red"; recolours it.The example below has a button. When you click it, JavaScript changes the text of a paragraph. It is only three lines — but it is the same idea behind every interactive feature on the web, from a "like" button to a full quiz timer.
<!DOCTYPE html>
<html>
<head>
<title>JavaScript</title>
</head>
<body>
<p id="demo">Click the button to change this text.</p>
<button onclick="document.getElementById('demo').innerHTML = 'Hello, JavaScript!'">Click Me</button>
</body>
</html>
test.html, open it in your browser, and change the text to see what happens. That is how you learn — by changing things and watching the result.Finish all 30 lessons, pass the test (80%), pay ₹10 and get your certificate.
Take the testFree tutorials teach you the basics. Our paid courses add live projects, mentorship and a certificate.
Browse all coursesAsk about courses, website & more
Request human callback:
Download karne ke liye login karo. Login ke baad yahi page pe rahoge!
Naya ho? Register karo →