i want to make an very very basic rich-text editor, which works in all browser types.
i have the code at below.. but it only works on -8 IE browsers.
could someone help me to make this code crossbrowser..
Code:<script type="text/javascript"> <!-- function formatText (tag) { var selectedText = document.selection.createRange().text; if (selectedText != "") { var newText = "[" + tag + "]" + selectedText + "[/" + tag + "]"; document.selection.createRange().text = newText; } } //--> </script> <form name="my_form"> <textarea name="my_textarea"></textarea><br /> <input type="button" value="bold" onclick="formatText ('b');" /> <input type="button" value="italic" onclick="formatText ('i');" /> <input type="button" value="link" onclick="formatText ('link');" /> </form>

LinkBack URL
About LinkBacks





Reply With Quote

Bookmarks