急求html选择题代码怎么写

急求html选择题代码怎么写,第1张

<!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="">

  <script type="text/javascript">

  <!--

window.i =0

window.maxCount =10//题目总数10

function nextChoice () {

i++

if(i<=maxCount)

document.getElementById("contentDiv").innerHTML="当前第"+i+"题"

else {

document.getElementById("btnNext").hidden=true

document.getElementById("btnSubmit").hidden=false

}

}

  //-->

  </script>

  <style type="text/css">

#mainDiv{

width:500px

height:250px

border:blue 1px solid

}

#contentDiv{

width:490px

height:200px

border:green 1px solid

margin-left:4px

}

  </style>

  <title>Document</title>

 </head>

 <body>

  <div id="mainDiv" class="">

  题目内容:

  <div id="contentDiv" class="">

  </div>

  </div>

  <input id="btnNext" type="button" value="下一题" onclick="nextChoice()">

  <input id="btnSubmit" type="button" value="提交" hidden=false onclick="alert('提交成功!')">

 </body>

</html>

chrome测试!

把其它多选框的的id写成有规律的,譬如checkbox1,checkbox2,... ,checkbox5,

for(i=1i<6i++)

{

document.getElementByID("checkbox"+i).checked=true

}


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/6141558.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-03-16
下一篇 2023-03-16

发表评论

登录后才能评论

评论列表(0条)

保存