how to get the value of a textbox in some other textbox by javascript..
for example :
if we put 100 in textbox1 so the value that will come in textbox2 should be less o equal to the 100(i.e, value of textbox1) by clicking event of textbox2.
how to get this value please give the solution sir.


Pankaj Kumar ChoudharyRank #80 · 24.4K reputationPosted Feb 1, 2016, 7:34 PM EST
document.getElementById("txt2").value=document.getElementById("txt1").value;
}
Shubham KumarRank #621 · 3.8K reputationPosted Feb 1, 2016, 7:36 PM EST
var fistInput = document.getElementById("#firsttextbox").value; var secondInput = document.getElementById("#secondtextbox").value; if(firstInput === secondInput) { //DO SOMETHING THERE THE SAME } else if(firstInput > secondInput) { //DO SOMETHING FIRST IS GREATER THAN SECOND } else { //DO SOMETHING SECOND IS GREATER THAN FIRST }parul jainRank #4,672 · 331 reputationPosted Feb 1, 2016, 7:57 PM EST
Shubham KumarRank #621 · 3.8K reputationPosted Feb 1, 2016, 8:25 PM EST
{
var fistInput = document.getElementById("#firsttextbox").value;
var secondInput = document.getElementById("#secondtextbox").value;
if(firstInput == secondInput)
{
document.getElementById("#secondtextbox").value=fistInput;
}
else if(firstInput > secondInput)
{
document.getElementById("#secondtextbox").value=fistInput;
}
}
in asp.net replace input to asp:textbox
Ranjit PowarRank #553 · 4.4K reputationPosted Feb 1, 2016, 9:57 PM EST
$('#textbox2').click(function (){
var value=$('#textbox1').val();
$('#textbox2').val(value);
});
If it helps you, select it as correct answer.