public
Created

input mirroring quick example

  • Download Gist
mirror-demo.html
HTML
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
<html>
<head>
<title>demo</title>
<script type="text/javascript">
function mirrorInput(source, dest) {
var destination = document.getElementById(dest);
destination.innerHTML = source.value;
}
</script>
</head>
<body>
<p>
<span id="yourName"></span>
</p>
<form method="post">
<input type="text" name="name" onKeyUp="mirrorInput(this, 'yourName')" value="">
<button type="submit">Send</button>
</form>
</body>
</html>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.