Reputation: 15475
I have a div that contains a list of spans. And each span has a link. Is there a way to convert all of the link text to upper case?
<div>
<span><a href="#">abc</a></span>
<span><a href="#">def</a></span>
<div>
Thanks,
rod.
Upvotes: 2
Views: 1002
Reputation: 382826
.
$('div span a').text().toUpperCase()
Or you can use the CSS' text-transform:uppercase;
as well (which is ideal, you don't need jQuery actually)
Upvotes: 2
Reputation: 17732
use the CSS text-transform:
div span a { text-transform: uppercase; }
Or with jQuery:
$('div span a').css('text-transform', 'uppercase');
Upvotes: 2