tags:

views:

88

answers:

3
+2  Q: 

a href to upper

Hi All,

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.

+10  A: 
div span a { text-transform:uppercase; }
meder
I'd use `div > span > a`, but that's just me.
zneak
I would use the id of the div in his real page. This is a trivial example though just to show text-transform., and it's probably not necessary to use that selector. Yours wouldn't work in IE6.
meder
+3  A: 

use the CSS text-transform:

div span a { text-transform: uppercase; }

Or with jQuery:

$('div span a').css('text-transform', 'uppercase');
Ryan Kinal
+2  A: 

.

$('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)

Sarfraz