-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstantinnerhtml.html
More file actions
29 lines (26 loc) · 887 Bytes
/
instantinnerhtml.html
File metadata and controls
29 lines (26 loc) · 887 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
<!DOCTYPE html>
<html>
<head>
<style>
a:link{color:darkblue;text-decoration:none;}
a:visited{color:darkblue;}
a:hover{color:blue;text-decoration:underline}
a:active{color:red;}
textarea{outline:none;border:2px solid black;width:450px;height:400px;background-color:transparent}
button{outline:none;border:2px solid black;}
</style>
</head>
<body bgcolor="#333"><center>
<button id="trigger">uygula</button><br><br>
<div id="edit"><textarea id='editor'></textarea></div>
<a style="margin-top:500px;" href="https://stackoverflow.com/questions/24360545/write-html-code-in-div-and-see-result-instantly?noredirect=1&lq=1">kaynak</a><br></center>
<script>
var edit = document.getElementById('edit');
var editor = document.getElementById('editor');
var trigger = document.getElementById('trigger');
trigger.onclick = function() {
edit.innerHTML = editor.value;
};
</script>
</body>
</html>