javascript if else statement
<script type="text/javascript">
function ShowHideDiv() {
var approvalatt = document.getElementById("approvalatt");
var Attachmail = document.getElementById("Attachmail");
if (approvalatt.value === "No"){
Attachmail.style.display = "block";
}else {
Attachmail.style.display = "none";
}
}
</script>
This section will work on java script
<select class="form-select rounded-pill bg-light" aria-label="approvalatt" name="approvalatt" id="approvalatt" onchange=ShowHideDiv() required>
<option value="No" selected>No</option>
<option value="Yes">Yes</option>
</select>
Comments
Post a Comment