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.
我在这里做了自己的下拉菜单:http: //jsfiddle.net/Hunter4854/GJVjT/我正在尝试在 PS3 单词的左侧添加图像。我需要在每个<li>. 我已经尝试了我所知道的一切,但无法找出问题所在?
<li>
您在此代码中重建了自定义列表 html:
$('#test_select option').each(function(i){ html.push('<li rel="'+$(this).val() +'">'+$(this).text()+'</li>'); }); $('.custom-select ul').html(html.join(''))
因此,您放置的任何预定义 HTML 都会被它替换。
要修复,请执行以下操作之一: