How would i remove a class from all inputs onClick? I don't want it to remove the class of every input on the page at once when one input is click. I just want the clicked input to be removed of the class. But i want the code to apply to every input tag...if that makes sense...
I'm pretty sure jquery's "this开发者_StackOverflow中文版" would be used. I just don't know how to use it.
I'd like it to a remove a specific class, not all classes. so something like this.
removeClass("blank_input");
$("input").click(function(){
$(this).removeClass("blank_input");
});
Like this:
$('input').click(function(){
$(this).removeClass('blank_input');
})
$("input").click(function() {
$(this).removeClass("blank_input");
});
Yep, you're right, this
is involved.
You mean this?
$('input').click(function() {
$(this).removeClass("class_name");
});
精彩评论