JavaScript is a versatile, high-level programming language primarily used for web development. It enables interactive web pages and is an essential part of web applications. Alongside HTML and CSS, JavaScript is one of the core technologies of the World Wide Web.
<script type="text/javascript">
document.write("<p> Hello from the world of Javascript</p>")
</script>
<noscript> This browser does not support Javascript. Yikes!
</noscript>
<script type="text/javascript" src="call.js">
</script>
<noscript> This browser does not support Javascript. Yikes!
</noscript>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content = "width=device-width, initial-scale=1.0">
<title> CSS and HTML practice </title>
</head>
<body>
<header id ="main-header-page">
<h1 class="title">
Welcome to HTML!
</h1>
</header>
<main>
<section class="content">
<h2> This is a header </h2>
<p> This is a paragraph </p>
<a href="https://neelsoumya.github.io/" class="link">My webpage link</a>
</section>
</main>
<script type="text/javascript">
document.write("<p> Hello from the world of Javascript</p>")
</script>
<noscript> This browser does not support Javascript. Yikes!
</noscript>
<footer class="footer">
<p> This is a test footer </p>
</footer>
</body>
</html>
alertalert("This is a dialog box")
Fail silently
Move on to the next tags
console.log("Hello from console")
can also do
window.console & console.log("Hello from console")
💡 can have breakpoints in developer console in browser
comments //
string concatenation
x = 12 + "hello";
functions
use var for scoping local
<script>
gl = 123;
function check(){
var gl = 456;
}
check(); // call function
console.log("Value of gl is:", gl);
</script>