Hi,
What i want is:
I have a textarea. When user selects some text and presses a button "[smth]" is added to the begin and end of selected text. How can i do this? It must work on all browsers.
The same thing makes daniweb when you format a text (post).
Acute
-2
Junior Poster
Recommended Answers
Jump to PostIt is a similar example to the previous one created by Chokladkakan and it works in all commonly used browsers (Internet Explorer, Firefox, Chrome, Safari, Opera).
<head> <script language="JavaScript"> function AddSMTH () { var textarea = document.getElementById("test"); if (textarea.selectionStart === undefined) { // Internet Explorer // create …
All 3 Replies
Chokladkakan
0
Newbie Poster
gumape
3
Newbie Poster
Chokladkakan
commented:
Despite not being an answer to an inquiry of mine, the answer is throughout enough to deserve a reputation bump I say.
+1
Acute
-2
Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.