I have a situation where a series of divs are created in a grid. Each has an event handler that is registered on the div id click event.
Each div has a span element and inside the span element is a text character.
The.
In DOM compliant browsers the user can click on the charater itself and the
click event will be handled correctly.
In Internet Explorer (testing in v7) the user has to click on the part of the div
that is visible around the characters field, but not on the character itself.
I tried setCapture() but it still doesn't handle the click event then the user
clicks on the character itself.
Code:
/* script generated content with dom createELement() etc...
<div id="(assigned id)" (click event assigned handler)> <span class="styleRules"> (char) </span> </div>
*/
// gameSet is an array containing the list of ids assigned the div elements
// this is run AFTER all the content is appended
if(document.attachEvent)
{
for(var i = 0; i < gameSet.length; i++)
{
var el = document.getElementById(gameSet[i]);
//// el.setCapture();
el.attachEvent('onclick', function(){ IEFindId() });
}
}
If the user clicks on the <span>char</span> element nothing happens
What is supposed to happen:
The coordinates of the div handling the click, swap with another divs coordinates
Thanks for time and attention
JK