Why this code doesn't work? is "id" attribute required?
<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>
Thanks!
document.write()is not what you think it is.