1

Temat: 4 przyciski

<script>
  function fun1(x)   
  {
    var b1 = document.getElementById('b1');
    var b2 = document.getElementById('b2');
    var b3 = document.getElementById('b3');
    var b4 = document.getElementById('b4');
    //
    b1.value="-"; b2.value="-"; b3.value="-"; b4.value="-";
    if (x==1) b1.value="@";
    if (x==2) b2.value="@";
    if (x==3) b3.value="@";
    if (x==4) b4.value="@";
  }
</script>


<form>
<input type="button" value="@" onclick="fun1(1)" id="b1" onmousemove="fun1(1)">
<input type="button" value="-" onclick="fun1(2)" id="b2" onmousemove="fun1(2)">
<input type="button" value="-" onclick="fun1(3)" id="b3" onmousemove="fun1(3)">
<input type="button" value="-" onclick="fun1(4)" id="b4" onmousemove="fun1(4)">
</form>