How to Run Javascript First Program

Example

“Welcome to PHPGurukul!” program:

Open Notepad, write JavaScript codes as follows:

<html>

<head>

<title>

The first JavaScript Program

</title>

<head>

<body>

<script language="javascript">

document.write ("<h2>Welcome to PHPGurukul! </h2>")

</script>

</body>

</html>

Please save the file with name “JavaScriptFirstProgram.html”.

Double click “First JavaScript.html” file, the ” JavaScriptFirstProgram.html” will be run in a browser, and see the output.

Welcome to PHPGurukul!

Explanation

document.write ("<h2>Welcome to PHPGurukul! </h2>") the output will be Welcome to PHPGurukul!

Leave A Reply

Your email address will not be published.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

Privacy & Cookies Policy