How to hide and display the div tag when selecting a fixed value in the drop-down list in js
This article mainly introduces "how to hide and show the div tag when selecting a fixed value in the current drop-down list in js". In the daily operation, it is believed that many people have doubts about how to hide and show the div tag when selecting a fixed value in the current drop-down list in js. The editor consulted all kinds of materials and sorted out a simple and useful operation method. Hope to help you answer the question of "how to hide and show the div tag when selecting a fixed value in the current drop-down list in js"! Next, please follow the editor to study!
$("# btn_add") .click (function () {$("# classIds") .hide (); / / hide div}) / / $("# typeId") .click (function () {function showTypeId () {var index=document.getElementById ("typeId") .selectedIndex; alert ("Index -" + index) / / when the subscript (starting from 0) or index is 3, div if (index==3) {$("# classIds") .show () / / shows div}}