I have this code:
$(document).ready(function() { $('.fa-crosshairs').click(function() { $('*').click(function() { var currentclass = $(this).attr('class'); }); }); $('#1color').click(function() { $('body').css({ "background-color": "black" }); }); });
I need to get currentclass var and then use it instead of $ ('body'). css, but I don't know how to do this.
The point is to get one element by clicking and then changing its css when I click ('# 1color')
source share