Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个非常基本的问题,我试图将变量传递给以下选择器
var image = $('#'+$ID ul li).find('input').eq(0).val();
但是有一个语法错误我需要改变什么?
我想你只是想要这个:
$('#' + $ID + ' ul li')...
你忘了再次打开字符串。
以防万一$ID碰巧是一个 jQuery 对象:
$ID
$('#' + $ID.attr('id') + ' ul li')...