I have following html code where on clicking a particular button i want to change the color of a particular html element.
<paper-button style="background:blue" class="blue"></paper-button>
<paper-button style="background:red" class="red"></paper-button>
this is my script
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>
$(document).ready(function(){
$(".blue, .red").click(function(){
$(".abc").css("background-color", $(".blue, .red").css("background-color"));
});
});
</script>
on clicking both the buttons the color of that element changes but changes to blue and doesn't change to red. When i change my code to
<paper-button style="background:red" class="red"></paper-button>
<paper-button style="background:blue" class="blue"></paper-button>
in this case the color changes to red irrespective of the button pressed. How to make sure that the color changes to the button pressed.