HTML:
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
| <html> <head> <script language="JavaScript"> function ClipBoard() { var originalstr = copytext.innerText; var originalstr = document.getElementById('copytext').innerText; var newstring = originalstr.replace(/#/g,"\t"); holdtext.innerText = newstring; var Copied = holdtext.createTextRange(); Copied.execCommand("Copy"); } </script> </head> <body> <span name="copytext" id="copytext"> Bla## bla </span> <textarea id="holdtext" style="display:none;"> </textarea> <button onClick="ClipBoard();">Copy to Clipboard</button> </body> </html> |
Bovestaande code plaatst "blabla" op het clipboard nadat het de "#" omgezet heeft in tabs.
Echter in firefox werkt het niet.
Krijg de melding "copytext is not defined "
Kan iemand me verder helpen?