Q:

Add a class to an element with javascript

I was wondering if someone could help me. I'm trying to add .fancy-btn to the below using JavaScript.
<div class="button transparent_2">
<a class="extra-color-3" href="#">Get a quote</a>
</div>

I want .fancy-btn class added to the div container, but cant seem to figure out how to achieve is
Thanks

A:

You need to use .addClass():
$(".transparent_2").addClass('fancy-btn')

