0
我通過Adobe InDesign CC創建了一個EPUB。將項目導出到EPUB後,我提取了該文件,以便可以插入用於練習的(html,javascript)頁面。有人請幫助我如何設法從epub(可能是得分)向網站投擲價值(如果在線),並在離線時將價值(分數)存儲在epub中。EPUB分數捕捉
<form action="#" method="post">
<section id="1" epub:type="item">
<p>1. smile - smiled <label id="checker" style="color:red"></label></p>
<input type="radio" id="myRadio" name="c1" value="1" />
<label>YES</label>
<input type="radio" id="myRadio" name="c1" value="0" />
<label>NO</label><br/>
</section>
<section id="2" epub:type="item">
<p>2. dance - danced <label id="checker2" style="color:red"></label></p>
<input type="radio" id="myRadio2" name="c2" value="1" />
<label>YES</label>
<input type="radio" id="myRadio2" name="c2" value="0" />
<label>NO</label><br/>
</section>
<section id="3" epub:type="item">
<p>3. rise - rised <label id="checker3" style="color:red"></label></p>
<input type="radio" id="myRadio3" name="c3" value="1" />
<label>YES</label>
<input type="radio" id="myRadio3" name="c3" value="0" />
<label>NO</label><br/>
</section>
</div>
</form>
繼承人的JavaScript:
temp = 0;
if (getRadioVal(document.getElementById('demoForm'), 'c1') === "1") {
temp = temp + 1;
} else{
document.getElementById('checker').innerHTML = "| wrong";
}
if (getRadioVal(document.getElementById('demoForm'), 'c2') === "1") {
temp = temp + 1;
} else{
document.getElementById('checker2').innerHTML = "| wrong";
}
if (getRadioVal(document.getElementById('demoForm'), 'c3') === "0") {
temp = temp + 1;
} else{
document.getElementById('checker3').innerHTML = "| wrong";
}
document.getElementById("score").innerHTML = temp;