I have the following code structure,
<a href="sample-test"> Text </a>
I am selecting the a using jQuery selector,
jQuery('a[href="sample-test"]').css({'backgroundColor' : 'yellow'});
and i want to replace the tag with any tag like <abbr></abbr>
let me know how to do it using jQuery.
Try this:
jQuery('a[href="sample-test"]').replaceWith($('<abbr>' + this.innerHTML + '</abbr>');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With