我是 jquery 的新手,我遇到了一个有点奇怪的问题。在 jquery 中创建一个 div 后,我不能使用它,这个例子将告诉你问题是怎么回事!假设在 get.php 页面中只有:echo "test test"; 我文件中的代码:
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function()
{
$("#bda").click(function()
{
$.post("get.php",function(data){
$("#tdiv").append('<div class="info" >'+data +'</div>');
});
});
$(".info").click(function()
{
alert("done");
});
});
</script>
</head>
<body>
<div id="bda">click here</div>
<div align="center" style="border:1px solid blue" id="tdiv">
example
</div>
<div class="info" >it works here</div>
有人能帮我吗..