473,513 Members | 11,702 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to get attributes of a column in Netscape 4.08?

2 New Member
I need to get the attributes of a column in netscape navigator 4.08.

In IE I have got the result for the following script.

[HTML]<html>
<head>
<script language="JavaScript">

function getAttr()
{

alert(event.srcElement.className);
// the output will be :- col;

alert(event.srcElement.name);
// the output will be :- lblCol1;

}
document.onmousedown=getAttr;
</script>
</head>
<body>
<form name="frm1" method="post" action="">

<table>
<tr>
<td class="col" name="lblCol1" id="lblCol1">Hello</td>
</tr>

</table>

</form>
</body>
</html>
[/HTML]
What change I need to do to get the class name and name.

could anybody help me please.

Thanks in advance.
Sep 20 '06 #1
1 1255
acoder
16,027 Recognized Expert Moderator MVP
You need to pass the event as an argument for non-IE browsers, i.e.
Expand|Select|Wrap|Line Numbers
  1. function getAttr(e) {
  2.     if (!e) e = window.event;
  3.     // now 'e' is the event in all browsers
Next, the element which is the target, is srcElement in IE, but target in other browsers, so:
Expand|Select|Wrap|Line Numbers
  1. if (e.target) target = e.target;
  2. else if (e.srcElement) target = e.srcElement;
  3. // now target contains the target element
May 14 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
2562
by: Dan Sikorsky | last post by:
How can I get the recordset attributes for a table field in SQL Server 2000 to report the field updatable attribute correctly ... mine keeps saying the fields are not updatable? That is, (...
1
3457
by: John | last post by:
I'm developing an application for medical use that will be used to capture patient background and visit data. The application will have approximately 50 forms, with an average of about 20 fields...
2
1671
by: Netto | last post by:
**** Post for FREE via your newsreader at post.usenet.com **** When I try to use a created attribute for the tag "input", it works fine with IE 6, but it seems not to be recognized by Netscape...
6
3509
by: Olly | last post by:
I've found a basic script, however I also need to add alt and title attributes as well, how would I go about doing this? Here's the script I found: Thanks <script language="JavaScript"> <!--...
18
2127
by: Jonathan Carmichael | last post by:
I am building a website for the first time. In attempting to validate my frameset html file I came across the following URL http://www.w3.org/TR/1999/REC-html401-19991224/ The 3 errors I am...
4
2012
by: Mike Jansen | last post by:
Does anyone know why if I create a complexType based off another complexType using xsd:extension the attributes don't seem to be inherited? Is this a bug/non-implementation in the .NET Schema...
3
3785
by: Andy | last post by:
Hi, Have just found a bug in Netscape for some of my Javascript code - works ok in Internet Explorer. Given the following form element: <input type="text" compulsory = "yes" name="an_el"> ...
2
2233
by: silverbob | last post by:
I have been writing web pages for years using these attributes to the body tag: <body bgcolor=#FFFFFF marginwidth=0 leftmargin=0 marginheight=0 topmargin=0> I'm now attempting to bring my...
23
1618
by: Frank Millman | last post by:
Hi all I have a small problem. I have come up with a solution, but I don't know if it is a) safe, and b) optimal. I have a class with a number of attributes, but for various reasons I cannot...
0
7254
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
7153
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7373
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7432
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...
1
7094
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
7519
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...
1
5079
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...
0
4743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
796
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.