I`m from Russia, so sorry for bad English. I am loading a part of webpage with ajax.
for example
<script type="text/javascript">
$("#link1").click(function(){
$.post("ajax.php", { act: "load" },
function(data) {
$("#content").html(data);
});
});
</script>
<a href="#" id="link1">Click</a>
<div id="content"></div>
Ajax.php returns: <input type="button" id="button1" value="test">
Now I want to control this button from script too. I`m trying:
<script type="text/javascript">
$("#link1").click(function(){
$.post("ajax.php", { act: "load" },
function(data) {
$("#content").html(data);
});
});
$("#button1").click(function(){
alert('test');
});
</script>
but this doesn`t work. Can you help me? Thanks.