(23.06.2010 21:10)
Zeigt eine Vorschau des Textes im Textarea
|
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 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Just a Test</title> <script type="text/javascript"> //<![CDATA[ function preview(text) { text = text.replace(/\n/g, "<br>"); document.getElementById('html').innerHTML=text; } //]]> </script> </head> <body> <h1>Vorschau</h1> <div id="html" style="width:100%;"></div> <h1>Text</h1> <textarea onkeyup="preview(this.value)"></textarea> </body> </html> |