Can someone enlighten me?
<h1>My First Web Page</h1>
<p>My First Paragraph.</p>
<button onclick="myFunction()">Try it</button>
document.write("Oops! The document disappeared!");
document.write() is document's object method for dynamically "writing" text to the web document (that is your web page). <p></p> is a standard HTML tag used to insert (not dynamically) paragraphs into a web document.
So above web document contains besides HTML "h1" and "p" tags a button whose onclick event handler is connected to the myfFunction() which when called writes down to the web page "Oops! The document disappeared!" text.
Last edited by tech_soul8; 12-10-2013 at 12:07 PM.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)