get php posted id on ajax
I added two buttons, 1 on html and one on php .... by getting second
button with ajax..
but when i add event to the buttons the one on the html page works only
... need some help....
HTML
<input type="button" value="button 1" class="btn">
<div id="div"><div>
<script>
$.ajax({
url:"btn2.php", success:function(data){
$('#div').html(data);}
});
$('.btn').click(function(){
alert("button is wrking");
});
</script>
PHP
<?php
echo"<input type='button' value='button 2' class='btn'>";
?>
can any one help me on this
No comments:
Post a Comment