MR.Don't know MR.Don't know - 1 year ago 99
CSS Question

Change class on click

how to acomplish this:

when i click on


  1. Box
    will change icon

  2. Text and title will be different color

  3. Box Image get some overlay

This change will be active until i click again, then will be restarted to the old classes.
Thank you

<div class="col-md-4 wrapper">
<div class="inner">
<div class="image-box"></div>
<div class="main">
<h2 class="box-title">TITLE</h2>
<p class="box-text"></p>
<div class="box-foot">
<a href="">
<div class="box-img"></div>
<span class="white-line-vertical"></span>
<button type="submit" class="box-btn">
<span class="glyphicon glyphicon-star-empty" aria-hidden="true"></span>

Answer Source

Try this,


.clicked {
     color : #ececec; //whatever color you want to change to


$("").on("click", function(){
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download