var AddType = document.getElementById("addressType.form-control");
var otherAdd = document.getElementById("otherAddType.form-control");
AddType.addEventListener("show", function(){
if (AddType.value = "other"){
otherAdd.setAttribute("class", "show");
}else {
otherAdd.setAttribute("class", "hidden");
}
}, false);
Asked
Active
Viewed 23 times
0

Hien Nguyen
- 24,551
- 7
- 52
- 62

Resa S
- 1
- 2
-
[Deprecated `show event`](https://developer.mozilla.org/en-US/docs/Web/API/Element/show_event) .Most of the major browser not supported – prasanth May 18 '20 at 03:28
-
add the click event listener to the address type selector then add and remove the classes from classList. https://stackoverflow.com/questions/26736587/how-to-add-and-remove-classes-in-javascript-without-jquery – ganesh phirke May 18 '20 at 03:30