I want to embed a JavaScript if clause into a HTML code.There are two buttons named success
and danger
those are separated by a if
clause. I tried for it as following manner.
<script>
if (1 < 18) {
</script>
<button type="button" class="btn btn-success btn-rounded">Success</button>
<script>
}
else{
</script>
<button type="button" class="btn btn-danger btn-rounded">Danger</button>
<script>
}
</script>
But it did not work in properly. Then what should I do for it.