jquery - Insert missing UL tag to LIs -


because menu being generated dynamically using cms , way php somehow coded, missing ul tag, question how can insert/add/append ul tag enclose lis using jquery.

this rendered code cms

<h3 class="italic orange">accounting packages</h3> <div class="sidebarmenu">   <li><a href="#">what it</a></li>   <li><a href="#">how works</a></li>   <li><a href="#">packages</a></li> </div> 

thanks & regards said

you use jquery .wrapall() function:

$('.sidebarmenu').children().wrapall('<ul></ul>'); 

jsfiddle


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -