jQuery script to move an attribute of matched element to their children
- by UserControl
I have a set of anchors like
<a class="lb" href="#">text</a>
<a class="lb" href="#" style="width:200px">text</a>
<a class="lb" href="#" style="color: reen; width:200px">text</a>
that needs to be transformed to the following:
<a class="lb" href="#"><span>text</span></a>
<a class="lb" href="#"><span style="width:200px">text</span></a>
<a class="lb" href="#" style="color:green"><span style="width:200px">text</span></a>
I have no problem creating child span but don't know how to move parent's width styling.