[jQuery] Generate unordered list (noob)

[jQuery] Generate unordered list (noob)


Hello,
I need to generate an unordered list based on array values, this is
what i've been trying (where body is empty to begin with)
var data = new Array("option 1", "option 2", "option 3")
$(document).ready(function(){
var ul = jQuery("body").add("<ul></ul>")
for(i = 0; i < data.length; i++){
jQuery(ul).append("<li>"+data[i]+"</li>")
}
});
This does not work, the LI's are generated fine but the UL is nowhere
to be seen. What is the best technique to acheive what i'm trying to
do? (there may be more than one list in a parent element, which in
this case is the body)
Cheers
Si