How to I know event occurred by "for" attribute?
Is there something like flag?
I make sample html. I test it in Chrome.
<html>
<head>
<script>
var div1 = document.getElementById("div1");
</script>
</head>
<body>
<div id="div1" style="relatvie;width:500px;height:200px" onclick="alert(5)">
<input type="checkbox" id="checktest"></input><label for="checktest">12345</label>
</div>
</body>
</html>
In this case, if you click label then alert is occurred twice.
I want to single alert.
Do you mean something like this fiddle?
I added an id attribute to the label and then wired up a click event handler to it via jQuery. It may not be per spec, but it seems to work.