sampada pai
sampada pai

Reputation: 41

how to create list using jquery

how to create an unordered list using jquery which should contain images as items and behind the images link should be given to a specific function

i.e onClick on the list item it should call certain function

Upvotes: 0

Views: 924

Answers (1)

Dmitri Farkov
Dmitri Farkov

Reputation: 9671

If you must add using jquery:

$('body').append('<ul id="test" />');
$('#test').append('<li>'+data+'</li>')

$('ul li').click(function(){
    //onclick event
})

Upvotes: 1

Related Questions