I am looking to utilize swig (my chosen templating engine) for incorporating JavaScript code that will only display when the user selects the 'other' option from the select menu.
<div class="form-group">
<select class="custom-select">
<option selected>Select Switch Manufacturer</option>
<option value="cisco">Cisco</option>
<option value="netgear">NetGear</option>
<option value="d-link">D-link</option>
<option value="tp-link">TP-link</option>
<option value="hewlett-packard">Hewlett-Packard</option>
<option value="linksys">Linksys</option>
<option value="allied">Allied</option>
<option value="brocade">Brocade</option>
<option value="other">Other</option>
</select>
This specific piece of code should only be visible once the user has picked the 'other' choice. How can I achieve this using Javascript / swig?
<div class="form-group">
<input type="text" class="form-control" id="switch-manufacturer" placeholder="Switch Manufacturer">
</div> <!-- The input field for 'Switch Manufacturer' should only appear if 'other' is selected above -->