Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

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

2025-01-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

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

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report