IE6 not aplying style to DOM created buttons...??? (FireFox working fine)

N

neousr

var row = document.createElement('TR');
row.setAttribute('class',tipoclase);
.....
var cell = document.createElement('TD');
var theButton = document.createElement('input');
theButton.setAttribute('type','button');
theButton.setAttribute('value',description);
theButton.setAttribute('class',ButtonClass);
cell.appendChild(theButton);
row.appendChild(cell);

the above code works fine in Mozilla 1.0.7 (applying the style
correctly) but it looks like IE doen't care about the "class"
attribute... It presents fine the table.. but without any style (plain
old cells and buttons). Any idea? Any workaround?

Thanks in Advance..
 
D

Dag Sunde

var row = document.createElement('TR');
row.setAttribute('class',tipoclase);

row.className = tipoclase;
.....
var cell = document.createElement('TD');
var theButton = document.createElement('input');
theButton.setAttribute('type','button');
theButton.setAttribute('value',description);
theButton.setAttribute('class',ButtonClass);

theButton.className = ButtonClass;

cell.appendChild(theButton);
row.appendChild(cell);

the above code works fine in Mozilla 1.0.7 (applying the style
correctly) but it looks like IE doen't care about the "class"
attribute... It presents fine the table.. but without any style (plain
old cells and buttons). Any idea? Any workaround?

In short: element.className = "className";
 
N

neousr

In short: element.className = "className";

Not IE6 o FireFox work with that.. they just stuck.

with " element.setAttribute("class",typeclass); " Firefox works
perfectly and applies the css style perfectly.. IE6 just ignore that..
it works but without applying any style. "element" is a element "type"
"input" for which I set up more attributes that work... only the css
style don't work with IE6.

Any Idea
 
T

Thomas 'PointedEars' Lahn

(e-mail address removed) wrote:

Please provide proper attribution.
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
Not IE6 o FireFox work with that.. they just stuck.

WFM. Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050922
Firefox/1.0.7 (Debian package 1.0.7-1) Mnenhy/0.7.2.0

Have you had a look at the JavaScript Console?
with " element.setAttribute("class",typeclass); " Firefox works
perfectly and applies the css style perfectly.. IE6 just ignore that..
it works but without applying any style. "element" is a element "type"
"input" for which I set up more attributes that work... only the css
style don't work with IE6.

I think it is because of IE's known problem with "windowed controls".


PointedEars
 

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,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top