猿问

哪位高手来帮我看看呀

<!DOCTYPE html>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>无标题文档</title>

<script>


window.onload=function(){

    document.getElementById("as").onKeyPress=function(e){

    if(!e) e=window.event;

if(e.keyCode){keyCode=e.keyCode;}else

{keyCode=e.which;}

string=String.fromCharCode(keyCode);

document.getElementById("sa").innerHTML+=string;

}}


</script>

</head>

<body id="as">

<div id>

<p id="sa;">df

</p>

</div>


</body>

</html>

怎么运行不起呢?

sunny飒枫
浏览 1524回答 2
2回答

zeroweb

你这是要实现啥效果呢 怎么看不懂 你要表达什么
随时随地看视频慕课网APP

相关分类

JavaScript
我要回答