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
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>aller à la ligne dans un textarea</title>
<meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
<style type="text/css">
* {margin:0;padding:0;}
body {margin:10px;background:#000;color:#ddd;font-size:1em;font-family:Helvetica, Arial, sans-serif;}
</style>
</head>
<body>
<form id="f" method="post">
<!-- option HTML -->
<textarea id="t" name="t">Ma commande
</textarea>
</form>
<script type="text/javascript">
<!--
// option javascript
// document.getElementById("t").value = "Ma commande\n\n";
document.getElementById("t").focus();
//-->
</script>
</body>
</html> |