<html>
<head>
<title>test1</title>
</head>
<body>
<img src="button_r.gif" name="the_image">
<script language="javascript">
alert(1);
<a href="#" onMouseOver="document.the_image.src='button_d.gif';">change</a>document.the_image.src='button_d.gif';
</script>
</body>
</html>

解决方案 »

  1.   

    <html>
    <head>
    <title>test1</title>
    </head>
    <body>
    <img src="button_r.gif" name="the_image">
    <a href="#" onMouseOver="document.the_image.src='button_d.gif';">change</a>
    <script language="javascript">
    alert(1);
    document.the_image.src='button_d.gif';
    </script>
    </body>
    </html>
      

  2.   

    <script>标记内部不允许直接使用HTML标记。
      

  3.   

    <a href="#" onMouseOver="document.the_image.src='button_d.gif';">change</a><script language="javascript">
    alert("1");document.the_image.src='button_d.gif';
    </script>
      

  4.   

    alert里只能放变量或字符
    alert('1');
      

  5.   

    <a href="#" onMouseOver="document.the_image.src='button_d.gif';">change</a>
    这句话有何用?onMouseOver这个也有何用?