 <p>I might have understood your problem wrong, but try this.</p> <p>Give your anchor tag an id.</p> <p><code>&lt;a id='anchor_sym'&gt;&lt;/a&gt;</code></p> <p>Then, in <code>onClick()</code> method, do on of following:</p> <pre><code>/* Plain Javascript*/ var element = document.getElementById("anchor_sym"); element.className += " glyphicon-chevron-left"; element.className = element.className.replace("glyphicon-chevron-right", ""); /* Using JQuery*/ $('anchor_sym') .addClass('glyphicon-chevron-left') .removeClass('glyphicon-chevron-right'); </code></pre>