onblur for table

M

Mathias Fritsch

I try to run the following code, but no onblur/onfocus events happen.
Is onfocus/onblur implemented in ie/firefox?

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>
<form>
<TABLE BORDER="1"
onFocus="alert('This is the Example Table')"
onBlur="alert('This is the Example Table')"
onClick="alert('This is the Example Table')"<TR>
<TD>Cell Data</TD>
<TD>Cell Data<input type=button value=sometext ></TD>
</TR><TR>
<TD>Cell Data</TD>
<TD>Cell Data</TD>
</TR>
</TABLE>
<TABLE BORDER="1"
onFocus="alert('This is the Example Table')"
onBlur="alert('This is the Example Table')"<TR>
<TD>Cell Data</TD>
<TD>Cell Data<input type=button value=sometextothertext ></TD>
</TR><TR>
<TD>Cell Data</TD>
<TD>Cell Data</TD>
</TR>
</TABLE>
</form>
</body>
</html>
 
A

ASM

Mathias Fritsch a écrit :
I try to run the following code, but no onblur/onfocus events happen.
Is onfocus/onblur implemented in ie/firefox?

focus :
how do you expect to get to keep attention to a whole table ?
does document (or div) accept onFocus ?

and by the fact : how to blur it ... ?

you can have :
window.onfocus();
document.myForm.myElement.onfocus();


Probably that could work :

<table
onmouseover = "alert('this is a table')"
onmouseout = "alert('leaving table');">
 
R

RobG

I try to run the following code, but no onblur/onfocus events happen.
Is onfocus/onblur implemented in ie/firefox?

Yes, but generally only where the W3C HTML 4 specification says they
should be:

<URL: http://www.w3.org/TR/html4/index/attributes.html >

i.e.

A, AREA, BUTTON, INPUT, LABEL, SELECT, TEXTAREA


Browsers do implement non-standard properties, however even if you
discover a browser that does support focus and blur events for tables,
you've already discovered two popular ones that don't.

Therefore it is not a good idea to attempt to use it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,118
Latest member
LatishaWhy
Top