Change color of button in MVC using js
<p>I want to change the color of button on click (green) and if I am clicking to cancel button I want same color of button(blue)..I am using MVC .I have created a java script function for that button ..where I need to change..
this is my function</p>

<pre><code>function addNewTransCode() {
    $('.trShow').removeClass("saveBg");
    $('.transHide').attr("style", 'display:none;');
    $('.transShow').attr("style", 'display:block;');

    $('#trAddTransCode').attr('style', 'display:table-row;');
}
</code></pre>

<p>this is my html code for that button --</p>

<pre><code>  &lt;a href="javascript:addNewTransCode() ;" class="btn btn-default pull-right marginright11" &gt;+ New Transaction Code&lt;/a&gt;
</code></pre>