0

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

1
  • Is there a particular reason you need to construct the entire list in jquery. Where will the script be getting the images from and the links? Commented Mar 22, 2011 at 17:25

1 Answer 1

1

If you must add using jquery:

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

$('ul li').click(function(){
    //onclick event
})
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.