简体   繁体   English

在模式弹出窗口中-获取LI之间的值

[英]In modal popup - get the value between LI

<ul id='FileList'>
  <li>first</li>
  <li>Second</li>
  <li>Third</li>
  <li>Fourth</li>
  <li>Fifth</li>
</ul>

$("#FileList li").click(function() {
    alert($(this).text());
});

Inside modal popup, How can I alert the id of the li item clicked In normal HTML page, the above code works fine, but i could not able to get the value when the same div in modal popup 在模式弹出窗口中,如何提醒单击的li项的ID在普通HTML页面中,上述代码可以正常工作,但是当模式弹出窗口中的相同div时我无法获取该值

Thanks in advance Bharani 在此先感谢Bharani

Maybe you should try this way? 也许您应该尝试这种方式? :

$(document).on('click','#FileList li',function(){
    alert($(this).text());
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM