473,785 Members | 2,414 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 7897


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/
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_StyleProper ties.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
10362
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 scann all items/elements on the page for a z-index? Thanks, Wouter
11
3100
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" value="ID_BUTTON_OK">Login</button> </form>
9
9512
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, but according to the w3 TR on html 4.01, the a element can take onFocus commands, which to me means you can do document.getElementById(element).focus() ? I'm trying to get the focus to a specific paragraph, so the page scrolls to it on loading,...
2
1694
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 snippet: while (tr.sectionRowIndex < this.scrollRowsVisible && this._DBCacheS > 0) { //Scroll Up // this.tBody.removeChild(this._DBRowCache.element); this.tBody.deleteRow(-1);
2
2114
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 table, the contents of which are dynamic. there can be any number of rows in this table - somewhere between 50 and 500 would be the range. in each row - there can be any number of td's. the relative 'width' of a td in a tr is specified by a td's...
9
5313
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 http://blogs.crankygoblin.com/blogs/geoff.appleby/pages/50712.aspx. I've also read the post on this topic by bggraphics, but he doesn't arrive at a final result. The main problem I am having is that the layerX and layerY event properties don't work. They're supposed to return the...
3
2763
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 the checkbox IDs and row numbers. For example, pretend that there are 5 rows in the table. I have deleted 2nd and 4th. Now, it should make the 3rd row as 2nd row by updating the checkbox id and sno as chk2 and 2 resp. here is my code. <!DOCTYPE...
13
8757
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 is the behaviour I want make happen in IE. Does anyone know how to accomplish this? Thanks a lot Andy Birchall
0
9646
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10157
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10096
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9956
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5386
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5514
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4055
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3658
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2887
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.