Skip to content

Instantly share code, notes, and snippets.

@ideasatrandom
Created June 17, 2018 07:28
Show Gist options
  • Save ideasatrandom/5b1b083e7cb1493904215a18c58b4a4f to your computer and use it in GitHub Desktop.
Save ideasatrandom/5b1b083e7cb1493904215a18c58b4a4f to your computer and use it in GitHub Desktop.
basic-form-javascript created by ideasatrandom - https://repl.it/@ideasatrandom/basic-form-javascript
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>repl.it</title>
<link href="index.css" rel="stylesheet" type="text/css" />
</head>
<body>
<h1>Example Page 1</h1>
<p id="hello"></p>
<input id="typeit" /> <input type="button" id="sendit">Send It</input>
<script src="index.js"></script>
</body>
</html>
document.getElementById("sendit").addEventListener("click"
, function(evt){
var msg = document.getElementById("typeit").value;
var hello = document.getElementById("hello");
hello.innerHTML = msg;
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment