implemented with 1.3
Instead, try using a living event:
<ul>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
$('ul li span').live('click', function(){
// ...
});
$('ul li').append('<span>Click me</span>');
That should work.
On Jan 27, 8:15 am, errant <d.cheka...@gmail.com> wrote:
> Here is the code:
>
> HTML:
>
> <ul>
> <li></li>
> <li></li>
> <li></li>
> <li></li>
> <li></li>
> </ul>
>
> JS:
>
> $(function(){
>
> var handle = $('<span>Click me</span>');
> handle.click(function() {
> alert('Thanks');
> });
> $('ul li').append(handle);
>
> });
>
> With jQuery 1.2.6, each time I click on any list's element it shows
> alert. With 1.3.1 in FF3, Safari 3 & Opera 9.63 alert is only
> displaying when I click on first element. In IE6,7 everything is ok.
> Is this some kind of bug?
No comments:
Post a Comment