Get the App
SLTechnology News&Howtos  ›  Development  › 

How to hide and display the div tag when selecting a fixed value in the drop-down list in js

Shulou Source: shulou.com Published: 2022-06-03 06:36:41 11月15日 Update

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}}

Tags: Tags learning more indexing help practical next subscript staff students owners articles methods classes theory knowledge articles websites materials follow Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux vpn Huawei Microsoft MySQL