Skip to content

Instantly share code, notes, and snippets.

@appikonda
Last active August 29, 2015 14:14
Show Gist options
  • Save appikonda/807958083fc36d97ef35 to your computer and use it in GitHub Desktop.
Save appikonda/807958083fc36d97ef35 to your computer and use it in GitHub Desktop.
Mohnish Assignment #5
<html>
<head>
<titl>Assignment #5</titl>
</head>
<body>
<div>Input#1: <input type="text" id="one" value="" oninput="swapInput1()" /></div>
<div>Input#2: <input type="text" id="two" value="" oninput="swapInput2()" /></div>
<script>
// Explanation: https://www.youtube.com/watch?v=-74grOUO-dg&feature=youtu.be
// When you enter any text in Input#1,
// it should immediately appear inside
// Input#2 and Vice versa. This should
// as you type.
// Implement your solution here.
function swapInput1(){
var input = document.getElementById("one").value;
document.getElementById("two").value= input;
}
function swapInput2(){
var input = document.getElementById("two").value;
document.getElementById("one").value= input;
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment