How to add css to form elements if attribute class is already being used in Jquery
Posted
by Gublooo
on Stack Overflow
See other posts from Stack Overflow
or by Gublooo
Published on 2010-04-22T04:09:36Z
Indexed on
2010/04/22
4:13 UTC
Read the original article
Hit count: 338
Hey guys
This is probably a dumb question - I'm using Jquery to validate the form. So the form elements have the class="required" attribute.
input type="text" name="last_name" class="required"/>
Now if i want to apply some css properties to the input fields of this form - how do I do that.
- I do not want to declare a general css for all input elements - I have declared the css as follows:
input.form { color: #000; background: #fff; border: 2px solid #E1E1E1; font-size: 16pt; width:150px; }
And I want to use it this way
input class="form" type="text" name="last_name" class="required"/>
But this wont work as there are two class attributes here. So how do I handle this. Thanks
© Stack Overflow or respective owner