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.
This is my javascript function:
function abc(param)
{
var step =2;
if(n>0){
return `
<div>
**{% if step == '1' %}
<div class="box" style="background-color:red" id="prodcolor">
<span style="display:none"> Sample</span>
</div>
{% endif %}**
</div>
`;
}
}
I have highlighted the place where i have used if statement. This is my javascript file.