Hi! I'm new to this and I need help! My problem is a simple one, I guess: An User selects a text and klicks a button and, based on his selection, a HTML-snippet should be inserted into the source-code.
As an example: I mark a text and klick the "bold"-button - the editor adds <strong>*selection*</strong> to my source-code. How does this work? Is there any easy solution like "var xy=selection;xy='<strong>'+xy+'</strong>;insert xy;'" (... simplified...) or something like that?
I dont know generally how to alter the source-code dynamically - as another example, how do I manage to put HTML-code at the beginning and at the end of my source-code after klicking a button, for example: the user types "hello" and klicks a button, which should change the source code from "hello" to "<a href="www.hello.com">hello</a>".
Thanks for help, greets, FlashPanHunter!!!
As an example: I mark a text and klick the "bold"-button - the editor adds <strong>*selection*</strong> to my source-code. How does this work? Is there any easy solution like "var xy=selection;xy='<strong>'+xy+'</strong>;insert xy;'" (... simplified...) or something like that?
I dont know generally how to alter the source-code dynamically - as another example, how do I manage to put HTML-code at the beginning and at the end of my source-code after klicking a button, for example: the user types "hello" and klicks a button, which should change the source code from "hello" to "<a href="www.hello.com">hello</a>".
Thanks for help, greets, FlashPanHunter!!!