Hi this may be a silly question but when i click on a textfield i want the back ground to change colour but i do not see why it is not working
could someone tell me where i am going wrong
code is below
//JQUERY
$(function() {
$('input[type="text"]').focus(function()
{
$(this).addClass("focus");
});
$('input[type="text"]').blur(function()
{
$(this).removeClass("focus");
});
})
;
//CSS
.focus {
border: 2px solid #AA88FF;
background-color: #FFEEAA;
}
HTML
//All the textfield are type text when i inspect them too
You can do this in CSS with no need for jQuery (for the newer major browsers at least)
🙂