I have a 2 files. file1 and file2. In file1 i have input box. so, i am getting this value in a javascript function like this
<td>
<input onmouseleave="detect(this.value)" id="myqty" value="'.$items['qty'].'">
</td>
<script>
var retVal;
function detect(value)
{
retVal=value;
return retVal
}
</script>
I am returning that value. So in file2 i have javascript where i want to receive that returned value. how can i?
file2
$(document).on('mouseleave', '#myqty', function(e){
e.preventDefault();
var returnValue= detect();
});
but in var returnValue= detect(); i am getting nothing.
$("#myqty").val()$("#myqty").val()whenever you want theinputvalue?$("#myqty").val()