Insert the JavaScript code in the HTML page. Note that the <script> tag should appear in pairs and write the JavaScript code <script></script>
between them.
<script type="text/javascript">
Indicates that the text type is between <script></script>, JavaScript is meant to tell the browser that the text is in the JavaScript language.
<!DOCTYPE HTML><HTMLLang= "en"> <Head> <MetaCharSet= "UTF-8"> <Metaname= "Generator"content= "EditPlus?"> <Metaname= "Author"content=""> <Metaname= "Keywords"content=""> <Metaname= "Description"content=""> <Scripttype= "Text/javascript"> /*document.write ("Hello word");//The character must be quoted document.body.bgcolor= "Red";//assignment If it consists of two words, the first capital of the second word, the Hump method Document.wri Te ("*/Window.alert ("Welcome to visit XX Community"); varTruthbetold=Window.confirm ("are you over 18 years old and 18 years old please press Yes"); if(truthbetold) {Window.alert ("Welcome to visit! "); } Else{Window.alert ("Good-bye! "); //window.close ();Window.location.replace ("Http://tieba.baidu.com/f?ie=utf-8&kw=%E6%88%92%E8%89%B2&fr=search") } varname= "Wangbaoqiang"; varSex= "male"; var Age= " the"; varJob= "actor"; varJJR= "next door old song"; document.write (""+name+"'s personal information "); document.write ("<ol>"); document.write ("<li> Name:"+name+"</li>"); document.write ("<li> Gender:"+Sex+"</li>"); document.write ("<li> Age"+ Age+"</li>"); document.write ("<li> Occupation:"+Job+"</li>"); document.write ("<li> Brokers:"+JJR+"</li>"); </Script> <styletype= "Text/css"> </style> <title>JS Preliminary</title> </Head> <Body> <!--Document It is an object that represents the current document object - </Body></HTML>
"2016.11.21" JS