<script type="text/javascript">
function setproperty(Objet,value){
if(Objet.style.textAlign==value){
Objet.style.textAlign="";
}else{
Objet.style.textAlign=value;
}
}
</script>
Cliquez sur les blocs :<br>
ObjetJavascript.style.textAlign= "left"; <br>
<div style="text-align:right; cursor:pointer; width:300px; border:1px solid blue; " onclick="setproperty(this,'left')">textAlign textAlign textAlign textAlign textAlign textAlign textAlign textAlign<br>ext-align textAlign textAlign textAlign textAlign textAlign</div><br>
ObjetJavascript.style.textAlign= "right"; <br>
<div style="text-align:left; width:300px; cursor:pointer; border:1px solid blue; " onclick="setproperty(this,'right')">textAlign textAlign textAlign textAlign textAlign textAlign textAlign textAlign<br>ext-align textAlign textAlign textAlign textAlign textAlign</div><br>
ObjetJavascript.style.textAlign= "center"; <br>
<div style="text-align:left; width:300px; cursor:pointer; border:1px solid blue; " onclick="setproperty(this,'center')">textAlign textAlign textAlign textAlign textAlign textAlign textAlign textAlign<br>ext-align textAlign textAlign textAlign textAlign textAlign</div><br>
ObjetJavascript.style.textAlign= "justify"; <br>
<div style="text-align:left; width:300px; cursor:pointer; border:1px solid blue; " onclick="setproperty(this,'justify')">textAlign textAlign textAlign textAlign textAlign textAlign textAlign textAlign<br>ext-align textAlign textAlign textAlign textAlign textAlign</div>
Cliquez sur les blocs :
ObjetJavascript.style.textAlign= "left";
