1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| <script>
function test1(param,objet,indice) //<= le paramètre est un id
{
document.getElementById("testText"+indice).style.display = "inline";
objet.style.display = "none";
var aaa = document.getElementById('b2_'+indice);
aaa.style.display = "inline" ;
}
function test2(param,objet,indice) {
document.getElementById("b1_"+indice).style.display = "inline";
document.getElementById("testText"+indice).style.display = "none";
objet.style.display = "none";
}
</script>
<div id="div_0">
<strong style="color:red;text-align:center;margin-left:100;" > titi </strong><button type="button" id="b1_0" onclick="test1('titi',this,0);" >tester</button><span id="testText0" style="display: none;"> yes </span><button type="button" id="b2_0" onclick="test2('titi',this,0);" style="display: none;"> tester 2 </button></div>
<div id="div_1"><strong style="color:red;text-align:center;margin-left:100;" > titi </strong><button type="button" id="b1_1" onclick="test1('titi',this,1);" >tester</button><span id="testText1" style="display: none;"> yes </span><button type="button" id="b2_1" onclick="test2('titi',this,1);" style="display: none;"> tester 2 </button></div>
<div id="div_2"><strong style="color:red;text-align:center;margin-left:100;" > titi </strong><button type="button" id="b1_2" onclick="test1('titi',this,2);" >tester</button><span id="testText2" style="display: none;"> yes </span><button type="button" id="b2_2" onclick="test2('titi',this,2);" style="display: none;"> tester 2 </button></div>
<div id="div_3"><strong style="color:red;text-align:center;margin-left:100;" > titi </strong><button type="button" id="b1_3" onclick="test1('titi',this,3);" >tester</button><span id="testText3" style="display: none;"> yes </span><button type="button" id="b2_3" onclick="test2('titi',this,3);" style="display: none;"> tester 2 </button></div> |
Partager