Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/powerbi/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何制作下拉列表并在选中时更改内容-我的内容是jquery手风琴?_Jquery_Drop Down Menu - Fatal编程技术网

如何制作下拉列表并在选中时更改内容-我的内容是jquery手风琴?

如何制作下拉列表并在选中时更改内容-我的内容是jquery手风琴?,jquery,drop-down-menu,Jquery,Drop Down Menu,如何制作下拉列表并在选中时更改内容-我的内容是jquery手风琴 我在手风琴上有一个工作列表和描述,但我想通过添加一些下拉列表或类似的东西来对这些工作进行分类。因此,当您选择一个类别(非创造性工作)时,它仅显示该类别中的工作。必须能够支持jquery手风琴 谢谢:)在您的select元素中使用onchange=“”事件,或者让jQuery根据元素id/class/name来处理这个问题,具体取决于您。如果我没弄错的话,它不会干扰手风琴的工作 一个小例子: **html** <html&g

如何制作下拉列表并在选中时更改内容-我的内容是jquery手风琴

我在手风琴上有一个工作列表和描述,但我想通过添加一些下拉列表或类似的东西来对这些工作进行分类。因此,当您选择一个类别(非创造性工作)时,它仅显示该类别中的工作。必须能够支持jquery手风琴

谢谢:)

在您的select元素中使用onchange=“”事件,或者让jQuery根据元素id/class/name来处理这个问题,具体取决于您。如果我没弄错的话,它不会干扰手风琴的工作

一个小例子:

**html**

<html><body><select id="theList" onchange="showId();"><option>opt1</option><option>opt2</option></select></body></html>

**js**

<script>function showId() { var list = getElementById("theList"); alert(list.options[selectedIndex].value); </script>
**html**
opt1opt2
**js**
函数showId(){var list=getElementById(“theList”);警报(list.options[selectedIndex].value);

希望这能澄清我的意思。

我们能看看你的一些标记吗?
<select id="someid">
<option value="1">one</option>
<option value="2">two/option>
<option value="3">three</option>
<option value="4">four</option>
</select>
<p>change goes here and put it inside your accordion content tab</p>
$(document).ready(function(){
$('#someid').change(function(){
   $('p').html($(this).text());
});
});