<!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的文本值等于选中项
https://jsfiddle.net/La5tnaqo/