JavaScript is a language that runs in your web browser. It is often used to do things with HTML elements on the page, and can help interact with the user.
Here is an example that shows an alert message. The JavaScript code is between the <script> tags:
<!DOCTYPE html>
<html>
<head>
<title>My Page</title>
</head>
<body>
<script>
alert("Hello!");
</script>
</body>
</html>
This:
alert("Hello!");
calls the alert function. For now, just think of it as an instruction you give to the web page. It shows an alert:
Next: Variables in JavaScript
Leave a comment