为什么这段代码不起作用?是否需要“id”属性?
<html>
<head>
<script language="JavaScript">
function pprint(){
var a = tf.value;
document.write(a);
}
</script>
</head>
<body>
<input type="text" name="tf" value="Test">
<input type="button" onClick="pprint()" value="print" >
</body>
</html>
谢谢!