Nida
Nida

Reputation: 1702

How to replace text in anchor tag in jQuery?

I have a anchor tag

 <a class="bx-prev" href="">Prev</a>

Now I want replace text "Prev" with

     <i class="fa fa-arrow-right" aria-hidden="true"></i> 

How to do it in jquery?

Upvotes: 0

Views: 1619

Answers (1)

Sonu Bamniya
Sonu Bamniya

Reputation: 1115

use this script, it'll work surely;

<a class="bx-prev" href="">Prev</a>

$(document).ready(function(){
$('.bx-prev').click(function(){
 $('.bx-prev').html('<i class="fa fa-arrow-right" aria-hidden="true"></i>');
 return false;
});

});

Upvotes: 2

Related Questions