0% found this document useful (0 votes)
45 views3 pages

Lecture 109 - Detecting A Click - Clickdothtml

This document contains HTML and JavaScript code to detect clicks on div elements. It defines two divs with different styles - a green circle and two red squares. A click handler is attached to all divs using jQuery so that an alert pops up whenever a div is clicked, demonstrating how to detect clicks on elements.

Uploaded by

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

Lecture 109 - Detecting A Click - Clickdothtml

This document contains HTML and JavaScript code to detect clicks on div elements. It defines two divs with different styles - a green circle and two red squares. A click handler is attached to all divs using jQuery so that an alert pops up whenever a div is clicked, demonstrating how to detect clicks on elements.

Uploaded by

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

Detecting A Click: click.

html
!
!

<!doctype html>
<html>
<head>
<title>Learning jQuery</title>

<meta charset="utf-8" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />

<script type="text/javascript" src="jquery.min.js"></script>


<style>

#circle {
width:200px;
height:200px;
background-color:green;
border-radius:100px;
}

.square {
width:200px;

height:200px;
background-color:red;
margin-top:10px;
}

</style>

</head>

<body>

<div id="circle"></div>

<div class="square"></div>

<div class="square"></div>


<script>

$("div").click(function() {

alert("Div Clicked!");


});

</script>




</body>
</html>

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy