Hey there! I have a question about changing background color when clicking on a text field. I followed the code below but it doesn't seem to be working for me. Can someone help me figure out what's wrong?
//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
//I noticed all the text fields are of type text
when inspecting them.