<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> 

解决方案 »

  1.   

    呵呵问题已解决 i++; 
    下面加个
    window.location.hash = i;
    就搞定了爽 啊 ~~·->-
      

  2.   

    <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>