Skip to content

Instantly share code, notes, and snippets.

@mikestratton
Created April 18, 2015 01:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikestratton/721c69f96090c137e81f to your computer and use it in GitHub Desktop.
Save mikestratton/721c69f96090c137e81f to your computer and use it in GitHub Desktop.
Input/Output in same page.
<html>
<head>
<script src="http://code.jquery.com/jquery-2.1.3.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#submit").click(function(){
var postInputVal = $("#postinput").val();
$("#postecho").val(postInputVal);
console.log("OK!");
});
});
</script>
</head>
<body>
<div style="width:300px;float:left;">
<p>Input:</p>
<p><textarea cols="30" maxlength="9999" name="postInput" id="postinput" rows="6"></textarea></p>
</div>
<div style="width:300px;float:left;">
<p>Output:</p>
<p><textarea cols="30" maxlength="9999" name="postEcho" id="postecho" rows="6"></textarea></p>
</div>
<div style="clear:both;"></div>
<p><input type="submit" value="submit" id="submit" /></p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment