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="focussable">
Click on this paragraph to set focus.
</p>
<script type="text/javascript">
var p1 = document.getElementById('p1');
if (p1 && p1.addEventListener) {
p1.addEventListener(
'focus',
function (evt) {
var p = document.createElement('p');
p.appendChild(document.createTextNode(evt.type + ' for ' +
evt.target));
document.body.appendChild(p);
},
false
);
};
</script>
Not sure however whether tabbing to the element is supported.
--
Martin Honnen
http://JavaScript.FAQTs.com/