Some had this problem but I did not see any answer that fits mine.
Here is the html :
<div id="page">
......
<ul>
<li role="presentation">
<a id="selection"...... ></a>
</li>
<li role="presentation>
<a id="xxxx"></a>
</li>
<li role="presentation">
<a id="yyyyy"></a>
</li>
</ul>
.......
</div>
here is the javascript using Mootools (no choice) :
window.addEvent('domready', function() {
var myDivPage = document.id('page');
var as = myDivPage.getElements('li[role=presentation] a');
//as is an array of 3 elements
Array.each(as, function(element, index) {
if(element.id !== 'selection') {
element.addEvent("click", function(event) {
event.preventDefault();
event.stopPropagation();
alert("did you save?");
});
}
});
});
The event is indeed attached but when I click my link the alrt is displayed twice, as though the event occured twice. As you can see I stopped the propagation, so how could this happen ?
Thank you