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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
<html>
<body>
<p align="center">
<A href="javascript: Ajout('b');">GRAS</A>
<A href="javascript: Ajout('i');">Italique</A>
<A href="javascript: Ajout('u');">Souligne</A>
<br /><br />
<form name='LeForm' action='0test.htm' method='POST'>
<textarea rows='24' name='LArea' id='LArea' cols='70' wrap='virtual' ></textarea>
<br /><br />
<input type='submit' value='Validez'>
</form>
</p>
<script language="JavaScript" type="text/javascript">
<!--
function Ajout(Lui)
{
var mess = document.LeForm.LArea;
if (Lui=="b" || Lui=="u" || Lui=="i")
{
if (!document.selection) vapa=99;
else
{
mess.focus();
sel = document.selection.createRange();
if ( sel.text !="")
{
sel.text = "["+Lui+"]" + sel.text + "[/" + Lui+"]";
document.LeForm.focus();
}
else {
Tout=document.LeForm.LArea.value;
document.LeForm.LArea.value=Tout+"["+Lui+"]"+"[/"+Lui+"]";
}
}
}
}
//-->
</script>
</body></html> |
Partager