How Can I Create An Xhtml Page With A Javascript Block In The Lt Headgt Section

How can I create an XHTML page with a JavaScript block in the <head>section of the document and another JavaScript block in the <body>section. In the first JavaScript block, create four variables named string1, string2,string3 and string4. Assign the value start to string1, Assign the return value of a prompt() method as the value for string2. Assign the return value of a confirm() method as the value for string3. Assign the value end to string4.

In the second JavaScript block, create a document.write() statement that outputs the text Hello, World. Make this text Heading Level 3(<h3>). Create a second document.write() that outputs the values of each of the four variables created in the first JavaScript block.  Experiment with different methods of ensuring that a space exists between each value.  After the code is working properly, determine a way to output the four variables values on separate lines of the XHTML page.

Leave a Reply

Your email address will not be published. Required fields are marked *