How to change the text of corresponding node with attribute’s value using jquery
<div class="rating">
<h2 typename="First">One is First</h2>
<h2 typename="Second">Two is Second</h2>
<h2 typename="Third">Three is Third</h2>
</div>
to
<div class="rating">
<h2 typename="First">First</h2>
<h2 typename="Second">Second</h2>
<h2 typename="Third">Third</h2>
</div>
Here I want to change the h2 text with its corresponding attribute value typename.
How to do so ?
Check working jsFiddle http://jsfiddle.net/PTYZa/