1

I'm trying to add a class to an anchor tag within a custom field. Like:

<div class="custom-field-class"><a href="http://someurl.com" class="some-class">Awesome</a></div>

Thoughts on how to get some-class in place?

0

Using jQuery you can add a class to an anchor tag like this.

<script type="text/javascript" >
$(document).ready(function () {
$('.custom-field-class').children('a').addClass('some-class');
})
</script>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.