Created
January 28, 2015 23:14
-
-
Save rodvan/79a5ed7a3cd6d5e4bae4 to your computer and use it in GitHub Desktop.
// source http://jsbin.com/curecizuzi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<p>This is the number 1</p> | |
<p>This is the number 2</p> | |
<p>This is the number 3</p> | |
<p>This is number 4</p> | |
<div id="foo"> | |
</div> | |
<div> | |
<p>And this is the number 5</p> | |
</div> | |
<input type="text" id="user"></input> | |
<input type="text" id="message"></input> | |
<button onclick="add()">Add</button> | |
<script id="jsbin-javascript"> | |
var add = function() { | |
var el = document.createElement("p"), | |
user = document.getElementById("user"), | |
message = document.getElementById("message"), | |
content = document.createTextNode("User: " + user + " <br>Message: " +message), | |
divFoo = document.getElementById("foo"); | |
el.appendChild(content); | |
el.id = "bar"; | |
divFoo.appendChild(el); | |
}; | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">var add = function() { | |
var el = document.createElement("p"), | |
user = document.getElementById("user"), | |
message = document.getElementById("message"), | |
content = document.createTextNode("User: " + user + " <br>Message: " +message), | |
divFoo = document.getElementById("foo"); | |
el.appendChild(content); | |
el.id = "bar"; | |
divFoo.appendChild(el); | |
}; | |
</script></body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var add = function() { | |
var el = document.createElement("p"), | |
user = document.getElementById("user"), | |
message = document.getElementById("message"), | |
content = document.createTextNode("User: " + user + " <br>Message: " +message), | |
divFoo = document.getElementById("foo"); | |
el.appendChild(content); | |
el.id = "bar"; | |
divFoo.appendChild(el); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment