How can I set css style on page load to certain input boxes using jquery something like
$(document).ready(function() {
$("input, textarea").addClass("idle");
$("input, textarea").focus(function() {
$(this).addClass("activeField").removeClass("idle");
}).blur(function() {
$(this).removeClass("activeField").addClass("idle");
});
});
HTML
<input type="text" name="author" id="author" >
<input type="text" name=email id=email >
But this will add the style to each and every input and textarea which I want to avoid.
How can I apply the desired style to selective inputs/text area fields?