1

How to write if condition in below script

<script id="some-template" type="text/x-magento-template">
    <div class="wrapper">
if(data.id == 10) {
        <input id="<%- data.id %>" name="<%- data.name %>" placeholder="<%- data.placeholder %>" />
}
    </div>
</script>
2
<script id="some-template" type="text/x-magento-template">
    <div class="wrapper">
    <% if (data.id == 10) { %>
        <input id="<%- data.id %>" name="<%- data.name %>" placeholder="<%- data.placeholder %>" />
    <% } %>
    </div>
</script>
  • I want to make the dropdown value selected using the ternary operator, is there have any way to achieve that – senthil Apr 9 at 5:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.