Event-Bubbling the other way round ???
I´ve written this source
-
...
<div id="folderTree">
<span>2. Legen Sie fest auf welcher Ebene der Ordner erscheinen soll</span><br /><br />
<ul id="0"><li id="ersteEbene">Oberste Ebene</li></ul>
<ul>
<li id="1">Verfahrensanweisung</li>
<ul>
<li id="3">Verfahrensanweisung2</li>
<li id="4">Verfahrensanweisung3</li>
<li id="7">Test</li>
<ul>
<li id="8">Test2</li>
</ul>
</ul>
<li id="2">Arbeitsanweisung</li>
<ul>
<li id="5">Arbeitsanweisung2</li>
<li id="6">Arbeitsanweisung3</li>
</ul>
</ul>
<div id="spacer"></div><label for="wahl">Sie haben gewählt: </label><span id="wahl"></span>
<input type="hidden" name="data[Document][valueOfTree]" value="" id="DocumentValueOfTree" />
</div>
...
and this jquery-code
-
$(document).ready(function() {
$("input#valueOfTree").attr("value", "0");
$("ul li").css("cursor", "pointer");
$("ul li").bind("click", function() {
// Event-Bubbling im IE verhindern
if (document.all) {
event.cancelBubble = true;
}
var id = this.id;
var text = $(this).text();
if (id == "ersteEbene") {
id = 0;
}
alert(id + ":" + text);
$("div#folderTree span#wahl").text(text);
$("input#DocumentValueOfTree").attr("value", id)
});
});
In Firefox this code works perfectly.
But in IE I get this alert when I click on "Arbeitsanweisung":
-
2:Arbeitsanweisung Arbeitsanweisung2 Arbeitsanweisung3
But it should be
-
2:Arbeitsanweisung
Can anyone describe me what´s the problem?