0

I have a very basic question im trying to pass in a variable to the following selector

var image = $('#'+$ID ul li).find('input').eq(0).val();

but there is an syntax error what do I need to change?

1
  • $('#'+$ID + ' ul li') may be ? Commented Jan 22, 2013 at 18:12

1 Answer 1

1

I think you just want this:

$('#' + $ID + ' ul li')...

You forgot to open the string again.

Just in case $ID happens to be a jQuery object:

$('#' + $ID.attr('id') + ' ul li')...
Sign up to request clarification or add additional context in comments.

2 Comments

That does not quite work, maybe it's something i'm doing wrong can you look at this JsBin? jsbin.com/acaxos/1/edit
@Edward I don't know how to update jsbin, but you need 'Wednesday' rather than Wednesday (quotes) and a space before ul, i.e. ' ul...

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.