Assignment GDB Solution: DHTML Examples

loading...

Event on Double click

Event on Double Click <html> <head> <script> function gettip(txt) { document.getElementById(‘tip’).innerHTML=’is about Create websites by using scripting technologies for the World Wide Web’; } </script> </head> <body> <p>Double click the “Paktutorial.com”</p> <table> <tr> <th valign=”top”>Paktutorial.com</th> <th> </th> </tr> </table> </body> </html> OUTPUT: Double click the “paktutorial.com” Paktutorial.com

Event onkeyup

Event onkeyup <html> <head> <script> function writeMessage() { document.forms[0].mySecondInput.value=document.forms[0].myInput.value; } </script> </head> <body> <p>The onkeyup event occurs when the a keyboard key is on it’s way UP.</p> <form> Write a message:<br /> <input onkeyup=”writeMessage()” size=”20″> <input name=”mySecondInput” size=”20″> </form> </body> </html> OUTPUT: The onkeyup event occurs when the a keyboard key is on it’s way […]

Event onKeydown

Event onKeydown <html> <head> <script> function writeMessage() { document.forms[0].mySecondInput.value=document.forms[0].myInput.value; } </script> </head> <body> <p>The onkeydown event occurs when the a keyboard key is on it’s way DOWN.</p> <form> Enter your name: <input onkeydown=”writeMessage()” size=”20″> <input name=”mySecondInput” size=”20″> </select> </form> </body> </html> OUTPUT: The onkeydown event occurs when the a keyboard key is on it’s way […]

Event onblur

Event onblur <html> <head> <script> function message() { alert(“This alert box was triggered by the onblur event handler”); } </script> </head> <body> <p>The onblur event occurs when an element loses focus. Try to click or write in the input field below, then click elsewhere in the document so the input field loses focus.</p> <form> Enter […]

Event OnChange

Event OnChange: <html> <head> <script> function preferedBrowser() { prefer=document.forms[0].browsers.value; alert(“You prefer browsing internet with ” + prefer); } </script> </head> <body> <form> Choose which browser you prefer: <select onchange=”preferedBrowser()”> <option value=”Internet Explorer”>Internet Explorer</option> <option value=”Firefox”>Firefox</option> <option value=”Chrome”>Chrome</option> <option value=”Opera”>Opera</option> </select> </form> </body> </html> OUTPUT: Choose which browser you prefer: Internet ExplorerFirefoxChromeOpera