title: How do i pass the value from a variable to .html() using javascript
body: <p>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 <code>.html()</code></p>
  
  <p>Here is my script below:</p>
  
  <pre><code> $('#changeTime').change(function() {
              $("#checkoutT").hide();
              var time = $(this).val();
  
  
              var timeArr = time.split(":");
  
              var timevar = timeArr[0];
  
              var x = &lt;?php echo $minStayExp[0] ?&gt;;
              var calc = parseInt(timevar) + parseInt(x);
  
              console.log(timevar);
              console.log(calc);
              alert(calc);
  
  
              $("#checkoutTime").html('&lt;p class="text-sm text-muted"&gt;&lt;/p&gt;');
  
  
           });
  </code></pre>
  
  <p>Now i want my <code>value</code> in my <code>var calc</code> will passed to <code>.html()</code> line of code in here:</p>
  
  <pre><code>$("#checkoutTime").html('&lt;p class="text-sm text-muted"&gt; + calc +&lt;/p&gt;');
  </code></pre>
  
  <p>Something like this.</p>
  
  <p>Can someone help me figured this thing out? Any help is muchly appreciated. TIA</p>