How do I wrap an element's contents in another element in jQuery -


i have simple tag html

<ul>                   <li>something1</li>     <li>something2</li>     <li>something3</li>     <li>something4</li> </ul> 

how make if use jquery?

<ul>                   <li><a href="#">something1</a></li>     <li><a href="#">something2</a></li>     <li><a href="#">something3</a></li>     <li><a href="#">something4</a></li> </ul> 

wich 1-4 defined?

i'd suggest reading through jquery api:

$('li').wrapinner('<a href="#"></a>'); 

Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -