A simple JavaScript program
<!DOCTYPE HTML><HTMLLang= "en"><Head> <MetaCharSet= "UTF-8"> <title>Document</title> <styletype= "text/css"> </style> <Scripttype= "text/javascript">Alert ("the First JavaScript program"); </Script></Head><Body></Body></HTML>writing format for JavaScript code<Scripttype= "text/javascript"></Script>
Code location:
Head tag inside (beginner Advice)
Inside the body tag
Alert ("");
Console.log (""); output to the console of the browser a sentence to debug the code
Prompt (""); pops up an input box on the page
<!DOCTYPE HTML><HTMLLang= "en"><Head> <MetaCharSet= "UTF-8"> <title>Document</title> <styletype= "text/css"> </style> <Scripttype= "text/javascript">Alert ("First Alert"); Console.log ("Recruitment Information"); Prompt ("Enter information"); </Script></Head><Body></Body></HTML>
JavaScript program Initial