大家可能见到一些问卷调查网站,可以拖拽生成自己想要的调查问卷。本人自己完成一个基于按钮的生成调查问卷的功能(可以得到问卷中题目组成的json字符串),现在只有文本框、单选、段落描述三种类型。附下功大家参考:
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8">
<script src="http://libs.baidu.com/jquery/1.11.3/jquery.min.js"></script>
<style type="text/css">
.menu {
float: left;
width: 100px;
height: 200px;
margin-top: 200px;
margin-left: 100px;
/*background-color: #45B7FF;*/
text-align: center;
border: 1px solid #45B7FF;
}
.menu .menu_bar {
background-color: #45B7FF;
font-size: larger;
color: white;
height: 30px;
line-height: 30px;
}
.menu table {
margin-top: 10px;
margin-left: 30px;
text-align: center;
}
.menu table td {
height: 30px;
line-height: 30px;
}
.menu table td a{
text-decoration: none;
color: black;
}
.menu table td a:hover{
background-color: #CCCCCC;
color: white;
}
.container {
float: left;
width: 900px;
}
.head {
text-align: center;
}
.head button {
background-color: #45B7FF;
border-radius: 5px;
width: 100px;
height: 25px;
border-color: #45B7FF;
color: white;
margin-left: 100px;
}
.head div {
font-size: smaller;
margin-top: 5px;
margin-bottom: 10px;
color: #CCCCCC;
}
.head input[type=text] {
width: