0% found this document useful (0 votes)
52 views4 pages

Css Practical 8

Uploaded by

mayurkove428
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views4 pages

Css Practical 8

Uploaded by

mayurkove428
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Practical No.

Aim : Create a webpage to Implement Form Event part

JavaScript's interaction with HTML is handled through events that occur when the user or the
browser manipulates a page.

When the page loads, it is called an event. When the user clicks a button, that click too is an
event. Other examples include events like pressing any key, closing a window, resizing a
window, etc.

Developers can use these events to execute JavaScript coded responses, which cause buttons
to close windows, messages to be displayed to users, data to be validated, and virtually any
other type of response imaginable.

The standard HTML 5 events are listed here for your reference. Here script indicates a
Javascript function to be executed against that event.

Program:-

<body>

<div id="panel"></div>

<script>

function clickResponse()

this.innerHTML+="click detected <hr>";

function doubleclickResponse()

this.innerHTML+="Double click detected ";

Page | 1
function mousedownResponse()

this.innerHTML+="<br> mouse button down <br> ";

function mouseupresponse()

this.innerHTML+="<br> mouse button up <br> ";

function init()

var panel = document.getElementById("panel");

panel.innerHTML = "click here <br>";

panel.onclick = clickResponse ;

panel.ondblclick = doubleclickResponse ;

panel.onmouseup = mouseupresponse;

panel.onmousedown = mousedownResponse;

document.addEventListener("DOMcontentLoaded",init(),false);

</script>

</body>

</html>

Page | 2
Output:

Page | 3
Page | 4

You might also like