Css Practical 8
Css Practical 8
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()
function doubleclickResponse()
Page | 1
function mousedownResponse()
function mouseupresponse()
function init()
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