是否可以将Javascript放入电子书?我把它放在哪里?
我试图将计数器放入我的计数器然后上传它并且它不起作用。这是代码(它告诉我将顶部放入头部如何在电子书中执行此操作?)
<script type="text/javascript">
new_value = '0';
function increase() {
current_value = document.getElementById("counter1").value;
new_value = ++current_value;
document.getElementById("counter1").value = new_value;
}
function reduce() {
current_value = document.getElementById("counter1").value;
new_value = current_value - 1;
document.getElementById("counter1").value = new_value;
}
</script>
<textarea id="counter1" name="counter1" rows="1" cols="5" class="counter1">0</textarea>
<br>
<input type="button" value="+" id="add" onclick="increase();" />
<input type="button" value="-" id="sub" onclick="reduce();" />
该代码最初来自Scott Dizzle的科技论坛。