Please help me on how to concatenate php code on jquery html:
$('div#divID').html('<?php echo $fib->getFibonacci( " + limit + "); ?>");
in order to pass the value: var limit = $('#inputID').val()
of input after clicking the button. Thank you!
PHP Code
class Fibonacci {
public function getFibonacci($num){
...
return $fib;
}
}
$fib = new Fibonacci();
HTML
<input type="text" id="inputID">
<button id="buttonID">
<div id="divID">
JS
$('#buttonID').click(function() {
var limit = $('#inputID').val();
$('div#divID').html("<?php echo $fib->getFibonacci( " +limit+");?>");
});
Goal: to pass the value on input when calling Php function using jquery syntax. Is there possible way? Thank you.