user1679941
user1679941

Reputation:

How can I use jQuery to change the class of a DIV inside an A element?

I have the following:

<a id="menuPrev">
<div class="sprite-contol-double-180"></div>
</a>

Is there a way that I can use jQuery to change the class to "sprite-blank"

Upvotes: 0

Views: 40

Answers (2)

Mathlight
Mathlight

Reputation: 6653

You need this code:

$("#menuPrev > div").attr("class","sprite-blank");

Upvotes: 0

You can do it like this:

$('#menuPrev > div').removeClass('sprite-contol-double-180').addClass('sprite-blank');

Upvotes: 3

Related Questions