input[type="checkbox"].focus {border:0px;}<br>
input[type="text"].focus {border:0px;}
How can I combine the two things into one?
$("input[type='text'],input[type='checkbox']").focus {border:0px;}
input[type="checkbox"].focus {border:0px;}<br>
input[type="text"].focus {border:0px;}
How can I combine the two things into one?
$("input[type='text'],input[type='checkbox']").focus {border:0px;}
You need to do this work like this you can not add CSS on the jQuery like we do in css to add css using jQuery you can use css() jQuery API the method is css (propertyName, value)
focus(function(){
$(this).css("background-color","#FFFFCC");
});
For more information about the jQuery CSS check this link
$("input[type='text'],input[type='checkbox']").focus() {border:0px;}
focus returns the handler currently attached to the focus event. You want to actually invoke the method, so you need the empty argument list: focus()