473,386 Members | 1,873 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,386 software developers and data experts.

setAttribute doesnot work for InternetExplorer

hi,
i am working on javascript and have lots of problem in setting the attributes of various elements for example for my table element which i created i tried the following
Expand|Select|Wrap|Line Numbers
  1.  otable.setAttribute("bgcolor","#d6d6d6");
it does not give any error but does not work in IE but works in Mozila can any body tell me whats the problem
thank you
Sep 21 '07 #1
3 1160
acoder
16,027 Expert Mod 8TB
In IE, it is case-sensitive, so you would use bgColor. However, bgcolor is deprecated, so try:
Expand|Select|Wrap|Line Numbers
  1. otable.style.backgroundColor=...;
Sep 21 '07 #2
pbmods
5,821 Expert 4TB
Heya, Kolimukesh. Welcome to TSDN!

Please use CODE tags when posting source code:

[CODE=javascript]
JavaScript code goes here.
[/CODE]
Sep 21 '07 #3
pbmods
5,821 Expert 4TB
Merged duplicate threads.
Sep 22 '07 #4

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

Similar topics

7
by: Jonas | last post by:
This works fine in Win XP but does not work at all in Win 98. Private WithEvents objIExplorer As InternetExplorer I have to do it like this to get it to work in Win 98 Dim objIExplorer As...
3
by: timmy_dale12 | last post by:
Hello , im a java programmer whos gotten tangled up in some javascripts. Im really stuck on this one can , can aybody explain this to me. I have a javscript which is to clone a table row and...
6
by: Pugi! | last post by:
I use mycurrent_cell.setAttribute("style", "background-color:green"); and mycurrent_cell.setAttribute("colspan", "3"); to set some attributes of a table. The code works perfect in FireFox and...
5
by: gkelly | last post by:
Can someone explain what I am doing wrong, or why this will not work? I've tested this in IE6, Firefox 1.5 and Mozilla 1.7, all with the same result. Take for example this code: <html>...
11
by: jesdynf | last post by:
I'm having trouble applying a stylesheet to content I'm generating after the fact. Here's the sample code: <html> <head> <title>CSS/DOM Problem Example</title> <style type="text/css">...
2
by: Aaron Gray | last post by:
Whats going on with setAttribute on IE it appears to work on some examples and working code but not on other code that I am writting ? <style> .foo { font-size: 200%; } </style>
4
by: ICPooreMan | last post by:
I've got some code which works in firefox that's giving me fits in IE7 (maybe other versions too I haven't tested it). What I want to do is get the oncontextmenu attribute of something, change the...
14
by: Sri02 | last post by:
All, I was trying to add an onclick event using setAttribute to a <tdfrom javascript. Apparently the code doesnot seem to work in FF3 but works pretty well in IE7. Here is the snippet for ur...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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,...

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.