-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinnerHTML.html
More file actions
35 lines (31 loc) · 735 Bytes
/
innerHTML.html
File metadata and controls
35 lines (31 loc) · 735 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>AboutInnerHtml</title>
<style>
#div1 {width:200px; height:200px;
background:lightgrey;
border:3px solid rgb(248, 189, 189);}
</style>
<script>
window.onload=function ()
{
var oTxt=document.getElementById('txt1');
var oBtn=document.getElementById('btn1');
var oDiv=document.getElementById('div1');
oBtn.onclick=function ()
{
oDiv.innerHTML=oTxt.value;
//alert(oDiv.innerHTML)
};
};
</script>
</head>
<body>
<input id="txt1" type="text" />
<input id="btn1" type="button" value="Ange text" />
<div id="div1">
</div>
</body>
</html>