Dispaly value of one textbox to another textbox using Jquery & Javascript

<html>
<h2>Display value of two Textbox in Another Textbox Using Jquery</h2>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$("#firstname, #lastname").keyup(function () {
var a = $("#firstname").val();
var b = $("#lastname").val();
var c= a + ' ' + b;
$("#fullname").val(c);
});
});
</script>
Fisrt name:-<input type="text" id="firstname" ></input>
Last Name:-<input type="text" id="lastname" ></input>
Full Name:-<input type="text" id="fullname" ></input>
</br>
<!-- ===================================================================== -->
<h2>Display value of two Textbox in Another Textbox Using Javascript</h2>
Fisrt name:-<input type="text" id="first" ></input>
Last Name:-<input type="text" id="last" onkeyUp="copyText()" ></input>
Full Name:-<input type="text" id="full" ></input>
<script type="text/javascript">
function copyText() {
first = document.getElementById("first");
last = document.getElementById("last");
full = document.getElementById("full");
full.value = first.value + ' ' + last.value;
}
</script>
<!-- ===================================================================== -->
<h2>Copy Text from One Textbox to Another Using Jquery </h2>
<script>
$(document).ready(function(){
$("#textBox").change(function () {
$("#message").val($('#textBox').val());
});
});
</script>
<div>
TextBox 1 : <input type="textbox" id="textBox" class="valueEnter"></input>
TextBox 2 : <input type="textbox" id="message"></input>
</div>
<!-- ===================================================================== -->
<h2>Copy Text from One Textbox to Another Using Javascript </h2>
<script>
function copyText2() {
textBox2 = document.getElementById("textBox2");
message2 = document.getElementById("message2");
message2.value = textBox2.value;
}
</script>
<div>
TextBox 1 : <input type="textbox" id="textBox2" onkeyUp="copyText2()"></input>
TextBox 2 : <input type="textbox" id="message2"></input>
</div>
</html>

Output
Vineet Kumar Saini

3 responses to this post.

  1. Posted by Monoj Biswas on February 24, 2015 at 7:23 pm

    thanks you so much,because in this site from i got a many help.

    Reply

  2. Posted by Mike on June 29, 2015 at 5:27 pm

    nice work buddy

    Reply

  3. very very Thanks you so much

    Reply

Leave a reply to Mike Cancel reply