您好我正在尝试在 dojo 中使用 CheckedMultiSelect ...当我按下按钮时,CheckedMultiSelect 中的所有选中项目都应显示在文本框中..请编辑下面的代码...我尝试使用警报框它不起作用
<html>
<link rel="stylesheet" href="dijit/themes/claro/claro.css">
<script>dojoConfig = {parseOnLoad: true}</script>
<script src="dojo/dojo.js"></script>
<script>
require(["dojox/form/CheckedMultiSelect","dijit/form/Button"]);
</script>
<script>
function selectcont()
{
var e=document.getElementById("multiselect");
var str=e.options[e.selectedIndex].value;
}
document.write(str);
</script>
<body class="claro">
<select multiple="true" data-dojo-type="dojox/form/CheckedMultiSelect" id="multiselect" >
<option value="TN">Tennessee</option>
<option value="VA" selected="selected">Virginia</option>
<option value="WA" selected="selected">Washington</option>
<option value="FL">Florida</option>
<option value="CA">California</option>
</select>
<div>
<button data-dojo-type="dijit/form/Button" type="button" onclick="selectcont()">click me</button>
</div>
</body>
</html>