For example I have a css style like this :
input.validation-passed {border: 1px solid #00CC00; col开发者_如何学编程or : #000;}
The javascript validation framework I use will inject every input tag with a class="validation-passed" .For the elements like <input type='text' />
... , this is ok , but for <input type='button' />
, I want this is not applied , how should I do this ?
.validation-passed:not(input[type="button"]) {color:red;}
If you don't need to support IE6, you can use an attribute selector:
input[type="text"].validation-passed {border: 1px solid #00CC00; color : #000;}
I don't think you can. But you can inject a little piece of javascript to parse your inputs and add the class text-validation-passed
to all your text
inputs with the class validation-passed
(or remove the class from button input if you don't need it).
精彩评论