Skip to main content

Introduction to javascript

🤔What is JavaScript ?​

JavaScript is a dynamic programming language, a scripting language used to develop web applications, games, and more. It allows us to implement dynamic features on web pages that cannot do with just HTML and CSS. Javscript are supported by all browsers.

Brendan Eich invented JavaScript in 1995.

Code

console.log("Hello World");

Output

Hello World

console.log() are used just print any message that needs to be displayed to the user.

Example :

alert("Are you sure?");

Output :

output-1

The alert() method is like a pop-up message that shows up on a website or program with a message and a button to click. It's used to give important information to the user.

You can Add JavaScript in Html elements then use this script tag. 👇

<script></script>

Code

<!DOCTYPE html>
<html>
<head>
<script>
alert("Hello From JavaScript");
</script>
</head>
<body></body>
</html>

Output

output-2

Code

<!DOCTYPE html>
<html>
<head>
<script>
alert("Bye Bye");
</script>
</head>
<body>

</body>
</html>

Output

output-3

Code

<!DOCTYPE html>
<html>
<head>
<script>
alert("Hello From JavaScript");
alert("Bye Bye");
</script>
</head>
<body>

</body>
</html>

Output

output-2output-3