Created
November 30, 2014 22:04
-
-
Save devdays/beb4903a885d92dce988 to your computer and use it in GitHub Desktop.
SVG Events
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Click in SVG</title> | |
</head> | |
<body> | |
<h1>SVG User Interface</h1> | |
<!-- Create the SVG pane. --> | |
<svg height="100" width="100"> | |
<!-- Create the circle. --> | |
<circle cx="75" cy="75" r="50" fill="green" id="myCircle" onclick="circleClick();" /> | |
<text>Click on green circle.</text> | |
</svg> | |
<script type="text/javascript"> | |
// This function is called when the circle is clicked. | |
function circleClick() { | |
// Display the alert. | |
alert("You clicked the SVG circle."); | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment