473,406 Members | 2,954 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Table Element Focus events

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?

Thanks
Praveen

Jul 23 '05 #1
3 7877


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/
Jul 23 '05 #2
Thanks Martin. That worked like a charm!

Could you tell me where this is documented though? I have been looking
into the documentation listed in this website:
http://www.mozilla.org/docs/web-developer/

.... but didn't find the css style you mentioned.

Thanks
Praveen

Jul 23 '05 #3


Praveen wrote:

Could you tell me where this is documented though? I have been looking
into the documentation listed in this website:
http://www.mozilla.org/docs/web-developer/

... but didn't find the css style you mentioned.


These are experimental CSS extensions, sometimes based on W3C CSS 3 drafts.
For Mozilla the best documentation I know of is here:
<http://xulplanet.com/references/elemref/ref_StyleProperties.html>
Some of that stuff is specific to XUL styling with CSS but much applies
to both HTML, XML, and XUL styling in Mozilla.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

22
by: DJ WIce | last post by:
Hi, I'm looking for a script to get the hi-est z-index on a page. I want my javascript menu to be always on top of the page (moves along on top when you scroll down). Does anyone know how to...
11
by: Dom | last post by:
Hi, I wanted to use the Button Element to submit a form like this example: <form action="/test.exe" method="post"> <button id="ID_BUTTON_OK" name="_WEB_EVENT_HANDLER_" type="submit"...
9
by: s_m_b | last post by:
I'm trying to get an <a> element to gain the focus onload, but only get back 'has no properties'. Reading through this ng, its clear that unless the element is within a form, this doesn't happen,...
2
by: Jure Erznoznik | last post by:
I made a table that shows 20 rows of a table at a time. When the user presses down or up arrow, the table will scroll as necessary filling new rows. But I have a problem with the following code...
2
by: Dave Ekhaus | last post by:
hi i'm new to javascript. i'm hoping to get some help and find out if what i want to do is possible and - assuming it is, get some tips on how to accomplish the task. ok - assume i have a...
9
by: dli07 | last post by:
Hello, I'm trying to convert a piece of code that creates a dynamic vertical resizing bar in a table from internet explorer to firefox. It's based on a post from...
3
by: pranav13 | last post by:
hi all, im pranav. i have a table with checkbox, sno, book name, book price as coloumns in it. Everything is 5ne while adding and deleting rows. But my requirement is that, now i want to update...
13
by: andypb123 | last post by:
Hello, The onchange event fires in IE6 in a SELECT element when scrolling through the list with the up and down arrows on the keyboard. In Firefox it only fires after you hit the enter key, which...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.