Quantcast
Channel: OutSystems Community
Viewing all articles
Browse latest Browse all 1476385

[Forums] How to change button color on its click

$
0
0

Hello Naredra,

For multiple buttons, to change the current clicked button color use the jquery.
Use the same class for all buttons. I used the class "buttonClass". When you click on the button append the class colorChangeClass.

Use the below jquery. Use your classes.

// CSS 

.colorChangeClass{

color: red;

}


$(document).ready(function(){

$(".buttonClass").removeClass("colorChangeClass");


$(".buttonClass").click(function(){

  $(".buttonClass").removeClass("colorChangeClass");

  $(this).addClass("colorChangeClass");

});

});


Viewing all articles
Browse latest Browse all 1476385

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>