Demo of Return Data by function using JQuery





HTML

<input type=button id=b1 value='Show' >

jquery


<script>
$(document).ready(function() {
////////////////
my_function=function my_function(str){
return str+" I am plus2net ";
}
////////////
$('#b1').click(function(){
str = my_function('hi'); // calls another function
$('#d1').html(str);
})
})
</script>