87,921
社区成员
发帖
与我相关
我的任务
分享
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>无标题页</title>
<script type="text/javascript">
var i= 0;
function change(){
i++;
document.getElementById('dd').innerHTML = ' <a onclick="change();" href="#' + i + '"> <img src="http://nimg.qihoo.com/qhimg/quc_img/48_48/0/203/356/5a6980.jpg"> </a>';
}
</script>
</head>
<body>
<div id="dd">
<a onclick="change();" href="#1"> <img src="http://nimg.qihoo.com/qhimg/quc_img/48_48/0/203/356/5a6980.jpg" /> </a>
</div>
</body>
</html>
<body>
<div id="dd">
<a onclick="change();" href="#1" id="oa"> <img src="http://nimg.qihoo.com/qhimg/quc_img/48_48/0/203/356/5a6980.jpg"> </a>
</div>
<script language="javascript">
var i= 1;
function change(){
i++;
// document.getElementById('dd').innerHTML = ' <a onclick="change();" href=#'+ i +'> <img //src="http://nimg.qihoo.com/qhimg/quc_img/48_48/0/203/356/5a6980.jpg"> </a>';
document.getElementById('oa').href="#"+i;
alert(document.getElementById('dd').innerHTML)//?啥意思?这不就改了?
}
</script>
</body>