Rod
Rod

Reputation: 15475

a href to upper

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

Answers (3)

Sarfraz
Sarfraz

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

Ryan Kinal
Ryan Kinal

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

meder omuraliev
meder omuraliev

Reputation: 186662

div span a { text-transform:uppercase; }

Upvotes: 10

Related Questions