I use jQuery and XAJAX at my page.
I have for example:
<span id="one">one</span>
<span id="two">two</span>
The page is successfully loaded and then I add an element with XAJAX:
<span id="one">one</span>
<span id="two">two</span>
<span id="three">three</span>
There is no page reload. But then the problem happends, and I can’t click the new added item:
$(document).ready(function() {
$("#one").click(function() {
alert('one');
}); // This works
$("#three").click(function() {
alert('one');
}); // This doesn't working
});
How can I make it work, so I can click the added element?
If you’re adding things use the live method: