Pass text of input to calling function

by delcon

HTML

<input id="input1" />
<input id="input2" onchange="GetText()" />

JavaScript

//
$( document ).ready(function() {               
    $("#input1").change(function(e){
    alert($(this).val())
    });
});


function GetText(){
    alert('Text should be displayed here');
}