有5个textarea。从这个1问题4回答如何将数据从textarea的文件写入到txt文件
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
Question <br /> <textarea id="question" rows="4" cols="70"></textarea>
<br /><br /><br /><br />
Answer <input id="answer1" type="checkbox" name="" value=""> <textarea rows="4" cols="70"></textarea>
<br /><br />
Answer <input id="answer2" type="checkbox" name="" value=""> <textarea rows="4" cols="70"></textarea>
<br /><br />
Answer <input id="answer3" type="checkbox" name="" value=""> <textarea rows="4" cols="70"></textarea>
<br /><br />
Answer <input id="answer4" type="checkbox" name="" value=""> <textarea rows="4" cols="70"></textarea>
<br /><br />
<button type="button">Save</button>
</head>
<body>
</body>
</html>
ID = “问题” 的问题 ID = “答案*” 答案 答案可以是两个或三个或四个
对于添加chekbox的答案,这个复选框需要修复正确的答案 如果复选框被屏蔽了,我希望点击类中的保存按钮后添加class“CORRECT”
有按钮“保存”
我需要脚本中保存从文本域数据为txt文件在此形式:
CODE
<div id="seconddiv" class="centered">
<h2>Question</h2>
<ul class="simpleList">
<li class="simpleListAnswer correct"> <span class="fa fa-square-o"></span>
<span class="simpleListText">A. Correct Answer</span></li>
<li class="simpleListAnswer"> <span class="fa fa-square-o"></span>
<span class="simpleListText">B. Incorrect Answer</span></li>
<li class="simpleListAnswer"> <span class="fa fa-square-o"></span>
<span class="simpleListText">G. Incorrect Answer</span></li>
<li class="simpleListAnswer"> <span class="fa fa-square-o"></span>
<span class="simpleListText">D. Incorrect Answer</span></li>
</ul>
</div>
我希望我解释什么,我想做的事情。 ..
在年底,所以我就:有数据
TXT文件:
<div id="seconddiv" class="centered">
<h2>Question 1</h2>
<ul class="simpleList">
<li class="simpleListAnswer correct"> <span class="fa fa-square-o"></span>
<span class="simpleListText">A. Correct Answer</span></li>
<li class="simpleListAnswer"> <span class="fa fa-square-o"></span>
<span class="simpleListText">B. Incorrect Answer</span></li>
<li class="simpleListAnswer"> <span class="fa fa-square-o"></span>
<span class="simpleListText">G. Incorrect Answer</span></li>
<li class="simpleListAnswer"> <span class="fa fa-square-o"></span>
<span class="simpleListText">D. Incorrect Answer</span></li>
</ul>
</div>
<div id="seconddiv" class="centered">
<h2>Question</h2>
<ul class="simpleList">
<li class="simpleListAnswer"> <span class="fa fa-square-o"></span>
<span class="simpleListText">A. Inorrect Answer</span></li>
<li class="simpleListAnswer correct"> <span class="fa fa-square-o"></span>
<span class="simpleListText">B. Correct Answer</span></li>
</ul>
</div>
<div id="seconddiv" class="centered">
<h2>Question</h2>
<ul class="simpleList">
<li class="simpleListAnswer"> <span class="fa fa-square-o"></span>
<span class="simpleListText">B. Incorrect Answer</span></li>
<li class="simpleListAnswer"> <span class="fa fa-square-o"></span>
<span class="simpleListText">G. Incorrect Answer</span></li>
<li class="simpleListAnswer correct"> <span class="fa fa-square-o"></span>
<span class="simpleListText">D. Correct Answer</span></li>
</ul>
</div>
等...等...