Autor | Zpráva | ||
---|---|---|---|
h0n24 Profil |
#1 · Zasláno: 9. 4. 2007, 16:28:20
Zdravím,
potřeboval bych zjistit, jak mohu vyrobit textarea, ve kterém by byl určitý text, jenž by byl po kliknutí celý vybrán. Už jsem to na některém webu zahlédl... Předem děkuji. |
||
MzM Profil |
#2 · Zasláno: 11. 4. 2007, 15:12:03
http://diskuse.jakpsatweb.cz/index.php?action=vthread&topic=44430&foru m=3&page=-1
<textarea cols="30" rows="5" id="area" > laskdj la kjsdlf asldj flka jsdlfkja lskdfj </textarea> <button onclick="vyber_vse('area')" >xXx</button> <script type="text/javascript"> function vyber_vse(t) { textarea = document.getElementById(t); // pro IE a jiné prohlížeče, které podporují "document.selection" if (document.selection) { textarea.selection.selectionStart = 0; textarea.selection.selectionEnd = 10; textarea.focus(); } // pro prohlížeče postavené na jádře Gecko else if (textarea.selectionStart) { textarea.selectionStart = 0; textarea.selectionEnd = textarea.value.length-1; textarea.focus(); } } </script> pro FF to jede pro IE jsem to zatím nenešel,.. |
||
h0n24 Profil |
#3 · Zasláno: 11. 4. 2007, 17:53:22
Děkuji, přesně to jsem potřeboval...
|
||
Časová prodleva: 17 let
|
Toto téma je uzamčeno. Odpověď nelze zaslat.
0