求助,关于innerHTML的

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//ZH-CN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <meta name="generator" content="HTML Tidy, see www.w3.org">
        <meta http-equiv="Content-Type" content=
        "text/html; charset=UTF-8">
        <title>innerHTML的疑惑</title>
    </head>
	<body>
		<span id="k1">上一页</span><br/>
		<input type="button" value="显示" onclick="pt1.show()">
		
		<script type="text/javascript">
			var pt1=new test();			
			function test(){}
			test.prototype.goPre=function(){
				alert("goPre");
			}			
			test.prototype.show=function(){
				var k1=document.getElementById("k1");
				k1.innerHTML="<a href='javascript:"+pt1+".goPre();'>上一页</a>";
			}
		</script>
	</body>
</html>

 

为什么innerHTML之后,点击上一页出错的?
提示错误:missing ] after element list
[Break on this error] [object Object].goPre();

你可能感兴趣的:(JavaScript,html,prototype)