<--
<button type="submit" name="judge" onclick="displaySelect();" value="judge">评分</button>
<div class="scoreNumberList" id="scoreList" style="display: none;">
<select>
<option onclick="optionScoreNumber(1)">1</option>
<option onclick="optionScoreNumber(2)">2</option>
<option onclick="optionScoreNumber(3)">3</option>
</select>
</div><!-- scoreNumberList结束 -->
<script type="text/javascript">
function displaySelect() {
var myId = document.getElementById("scoreList");
if(myId.style.display == "none"){
document.getElementById("scoreList").style.display = "block"; //当div是隐藏的时候,点击后会显示
}
else {
document.getElementById("scoreList").style.display = "none";//当div是显示的时候,点击后会隐藏
}
</script>
-->
麻烦大哥再帮我看下这个函数,给您追加,我想点击下拉列表中的一个值后跳转并传值,但是点击之后并没有反应,谢谢大哥!
function optionScoreNumber(scoreNumber){
location.href = '../../../src/com/servlet/gongyuAdmin/DoJudgeScore?scoreNumber='+scoreNumber;
}
这个方法不能直接加在option的标签上面 你得在select的值发生改变的时候去执行才行噢。
1
2
3
function displaySelect() {
var myId = document.getElementById("scoreList");
if(myId.style.display == "none"){
myId.style.display = "block"; //当div是隐藏的时候,点击后会显示
} else {
myId.style.display = "none";//当div是显示的时候,点击后会隐藏
}
}
function optionScoreNumber(scoreNumber){
location.href = '../../../src/com/servlet/gongyuAdmin/DoJudgeScore?scoreNumber='+scoreNumber;
}