jquery - How can I change the css of this when I click on anything but this? -


i attempting change css of menu items clicking anywhere else on screen. reset they're css properties after clicking on them , changing css they're defaults.

if have list item id="linkitem" how click on #linkitem change css of it.

thanks

$(document).on('click', function(e) {     if ( ! $(e.target).closest('#linkitem').length ) {         // clicked anywhere on element inside #linkitem (or itself)         $('#linkitem').css('color', 'red');     } }); 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -