<p class='sent' id='abc'>abc</p>
<p class='sent' id='abb'>abb</p>
<p class='sent' id='acc'>acc</p>
Styling with CSS
.sent:focus{
background-color:#e1e1e1; // Applies style when .sent is clicked
}
Interaction with JavaScript
$(".sent").click(function() {
$('.sent').css('background-color', 'transparent'); //works
$(this).css('background-color', '#e1e1e1'); //works
});
Why does the sent:hover
not work after the first click on sent
?