很多站长朋友们都不太清楚html多选题怎么写,今天小编就来给大家整理html多选题怎么写,希望对各位有所帮助,具体内容如下:
本文目录一览: 1、 急求html选择题代码怎么写 2、 50.(多选题)阅读下列HTML代码片段 3、 用js和html做一个有单选和多选题的考试页面,点击交卷得到分数?急!! 4、 多选题 HTML标记可以对( )网页元素进行描述。A 文本B 图片C 动画D 音频E 视频? 5、 一个问题有多个答案选择,提交后,在当前页面显示提交结果.html代码怎么写 6、 多个checkbox一次只能选择一个怎么写html 急求html选择题代码怎么写<!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测试!
50.(多选题)阅读下列HTML代码片段A B 正确
C:错误, border="3" 是指边框宽度为3像素 而不是厘米
D:错误: 该表格有3行2列 ,而不是2行3列
效果图
用js和html做一个有单选和多选题的考试页面,点击交卷得到分数?急!!<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
.div_bor{
border:1px solid #274b8b ;
padding: 5px 5px 10px 5px;
}
</style>
</head>
<body>
<div class="div_bor">
<p>这是题目</p>
<p><input type="checkbox" value="A"> A.选项1</p>
<p><input type="checkbox" value="B"> B.选项2</p>
<p><input type="checkbox" value="C"> C.选项3</p>
<p><input type="checkbox" value="D"> D.选项4</p>
<p><input type="checkbox" value="E"> E.选项5</p>
<p><button style="float: right" onclick="fn()">确定</button></p>
</div>
<script>
var rule = ['A','C','D'];//答案
var boxs = document.getElementsByTagName('input');
var check = [];
var score = 0;
function fn(){
check=[];
score = 0;
for(var i=0;i<boxs.length;i++){
if(boxs[i].checked){
check.push(boxs[i].value);
}
}
for(var j=0;j<check.length;j++){
if(rule.indexOf(check[j]) !=-1){
score++;
}else{
score--;
}
}
alert(Math.ceil(100/rule.length*score)+'分'); // 分数规则,自己定吧
}
</script>
</body>
</html>
多选题 HTML标记可以对( )网页元素进行描述。A 文本B 图片C 动画D 音频E 视频?<p>可以描述文本
<img>可以描述图片
<audio>可以描述音频
<video>可以描述视频
而动画则需要CSS或JS的辅助,故:除动画外全选
一个问题有多个答案选择,提交后,在当前页面显示提交结果.html代码怎么写你可以就提交到本控制器,用一个标记标识。action=s是就处理选择题
多个checkbox一次只能选择一个怎么写html需要准备的材料分别有:电脑、浏览器、html编辑器。
1、首先,打开html编辑器,新建html文件,例如:index.html,编写问题基础代码。
2、在index.html中的<script>标签,输入js代码:
$('input').click(function () {
var now = this;
$('input').each(function (i, e) {
if (now !== e) {
$(e).attr('checked', false);
}
})
});
3、浏览器运行index.html页面,此时每打钩一个checkbox,都会取消其它checkbox的打钩。
关于html多选题怎么写的介绍到此就结束了,不知道本篇文章是否对您有帮助呢?如果你还想了解更多此类信息,记得收藏关注本站,我们会不定期更新哦。
查看更多关于html多选题怎么写 怎么用html制作选择题的详细内容...