javascript - bootstrap如何通过选择下拉框把选择的值赋值给下拉框button?
伊谢尔伦
伊谢尔伦 2017-04-11 08:57:53
0
1
1070

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="Generator" content="EditPlus®">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<title>Document</title>
<!-- <link href="css/ejoy.css" rel="stylesheet" /> -->
<link href="http://libs.baidu.com/bootstrap/3.0.3/cs... rel="stylesheet">
<script src="http://libs.baidu.com/jquery/2.0.0/jquer...
<script src="http://libs.baidu.com/bootstrap/3.0.3/js...

</head>
<body>

<p class="mainmenu">

<p class="dropdown pull-right">
<button id="dLabel" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">

Dropdown trigger
<span class="caret"></span>

</button>
<ul class="dropdown-menu" aria-labelledby="dLabel" style="">

 <li tabindex="-1">aa</li>
 <li tabindex="-1">bb</li>
 <li tabindex="-1">cc</li>
 <li tabindex="-1">dd</li>

</ul>
</p>
</p>
</body>
</html>

比如当选中某项是 button的文本值等于选中项

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(1)
左手右手慢动作

https://jsfiddle.net/La5tnaqo/

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!