|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi all,
I'd like to assign "className" to an <input> tag, but I don't manage to do that. I tried using : document.form1.input1.className="inputStyleName"; in order to add a certain class to all inputs in my form, for exp to: <INPUT type="text"> I don't want to assign the className to the input in the html part, like <INPUT class="inputStyleName" type="text"> because ns4 does not like it, (the class has properties like border and stuff). I prefer not to write the whole form using document.write as well (regarding each browser) I'd like that for IE and ns6. Any suggestions? Thanks in advance |
|
#2
|
|||
|
|||
|
I inserted the <style> tags only when it's not ns4,and it's working great.
And now I have this style for all the inputs in the document. <SCRIPT language="javascript"> if (!NS4) {document.write("<STYLE type='text/css'>"); document.write("INPUT {etc.}"); document.write("</STYLE>"); } </SCRIPT> So happy I found the solution myself. :-) |
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > Assigning className to an input tag |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|