I have this bit of code which iScoll 4 displays correctly:
<ul id="thelist">
<li id="1">Option 1</li>
<li id="2">Option 2</li>
<li id="3">Option 3</li>
<li id="4">Option 4</li>
</ul>
but when I use this jQuery code it doesn’t work:
$("li").click(function(){
alert($(this).text());
});
and the most curious part is that this bit of code works:
$("#thelist").click(function(){
alert($(this).text());
});
Someone can help me with this?
There are several ways to write this; I’d try with
.on()and see what happens:Here’s a jsfiddle to test with.