Have a small problem.
I'm set jquery to respond to clicks in all div .. like this:
- $(document).ready(function() {
- $("div").click(function() {
- alert("klikk");
- });
- });
So do I have a html that says something like this:
- <div style="width: 200px; height: 200px; border: 1px solid #000" id="forste">
- <div style="width: 200px; height: 200px; border: 1px solid #000" class="andre">
- <div style="width: 200px; height: 200px; border: 1px solid #000" class="tredje">
- </div>
- </div>
- </div>
If I click on the box I get three alert messages.because there are 3 boxes inside each other.
First question: how do I get to just get one alertmessage every time I click
Second questions: How can I get just one alertmessage on the top div'n.
third (all good things come in threes) question: how do I manage to get the # for the div'n that was clickedon?