ボタンを押した時に、点数の加点、減点はできたのですが、
加点の代わりに、ボタンをおすごとに、画像を増やす、減らすことのできるようにしたいのですが、
いい方法が思いつきません。
よろしくお願い申し上げます。
html
1<p class="point" id="point">0</p> 2<form name="form" id="id_form"> 3 <input type="button" value="加点" onclick="countUp();"> 4 <input type="button" value="減点" onclick="countDown();"> 5 <input type="button" value="リセット" onclick="countReset();"> 6</form>
jQuery
1var $countB = 0; 2function countUp2() { 3 document.getElementById( "point" ).innerHTML = ++$countB; 4} 5function countDown2() { 6 document.getElementById( "point" ).innerHTML = --$countB; 7} 8function countReset2() { 9 document.getElementById( "point" ).innerHTML = $countB = 0; 10} 11function onButtonClick2() { 12 target = document.getElementById("output"); 13 target.innerText = document.forms.id_form.id_textBox2.value; 14}
回答1件
あなたの回答
tips
プレビュー