title: How to return html code in a javascript function with conditional statements
body: <p>I have a javascript function where i return a html code. In that piece of return statement i want to use if conditions. Please guide me how to use that.</p>
  
  <p>This is my javascript function:</p>
  
  <pre><code>function abc(param)
  {
    var step =2;
    if(n&gt;0){
  
      return `
          &lt;div&gt;
          **{% if step == '1' %}
            &lt;div class="box" style="background-color:red" id="prodcolor"&gt;
             &lt;span style="display:none"&gt; Sample&lt;/span&gt;
            &lt;/div&gt;
          {% endif %}**
          &lt;/div&gt;
      `;
  
    }
  }
  </code></pre>
  
  <p>I have highlighted the place where i have used if statement. This is my javascript file. </p>