Hi i have this change function in jquery when selecting the time, the time will calculate to four hours. Upon selecting using change function the time and calculate for four hours works well. Now my problem is how will i able to pass the value to my .html()
Here is my script below:
$('#changeTime').change(function() {
$("#checkoutT").hide();
var time = $(this).val();
var timeArr = time.split(":");
var timevar = timeArr[0];
var x = <?php echo $minStayExp[0] ?>;
var calc = parseInt(timevar) + parseInt(x);
console.log(timevar);
console.log(calc);
alert(calc);
$("#checkoutTime").html('<p class="text-sm text-muted"></p>');
});
Now i want my value in my var calc will passed to .html() line of code in here:
$("#checkoutTime").html('<p class="text-sm text-muted"> + calc +</p>');
Something like this.
Can someone help me figured this thing out? Any help is muchly appreciated. TIA
'<p class="text-sm text-muted">' + calc + '</p>'You did not close the strings....