I just want to know how can I display a javascript variable into html?
Below is my php code:
var duration = echo $postduration; ?>;
<
Make your code more concise with jQuery:
(1) Add this in your :
(2) Create an element where you want the variable to be displayed, and give it an ID, e.g.:
(3) Add this in your JavaScript:
var duration="";
$('#printHere').html(duration);
For your PHP, try the following two options:
=$postduration?>
or...