Praveen wrote:
In IE a table element will receive focus when you either tab into it or
when you click anywhere within the table. Mainly it fires the onfocus
event.
This doesn't happen in Mozilla (Firefox and Netscape).
Is there any setting or anyother way to force the table element to fire
the onfocus and onblur events?
Mozilla provides a CSS extension to make elements receive focus events
for which the HTML 4 specification doesn't define that, here is an
example for a paragraph element:
<html lang="en">
<head>
<title>-moz-user-focus CSS extension</title>
<style type="text/css">
..focussable {
-moz-user-focus: normal;
}
</style>
</head>
<body>
<p id="p1" class="focussab le">
Click on this paragraph to set focus.
</p>
<script type="text/javascript">
var p1 = document.getEle mentById('p1');
if (p1 && p1.addEventList ener) {
p1.addEventList ener(
'focus',
function (evt) {
var p = document.create Element('p');
p.appendChild(d ocument.createT extNode(evt.typ e + ' for ' +
evt.target));
document.body.a ppendChild(p);
},
false
);
};
</script>
Not sure however whether tabbing to the element is supported.
--
Martin Honnen
http://JavaScript.FAQTs.com/