jd2007 Posted July 26, 2007 Share Posted July 26, 2007 for e.g. i want to use in a textarea. its something like this forum. when i type a text, i highlight it and i click the B button, it turns bold...i want a same concept like that...give me an idea/hint... Link to comment https://forums.phpfreaks.com/topic/61843-how-can-i-use-js-to-take-a-text-which-is-highlighted-on-a-web-page-as-a-string/ Share on other sites More sharing options...
lighton Posted July 29, 2007 Share Posted July 29, 2007 perhaps you can use an event listener to record the movement of the mouse to find out where to insert the [b/][//b] for example on mousedown to indicate the begining of the string and onmouseup where the end of the string is, i have no idea if this would work or whether recording this kind of the data would be useful in a textbox but its a hint? I suck at javascript Link to comment https://forums.phpfreaks.com/topic/61843-how-can-i-use-js-to-take-a-text-which-is-highlighted-on-a-web-page-as-a-string/#findComment-309955 Share on other sites More sharing options...
AndyB Posted July 29, 2007 Share Posted July 29, 2007 Do you mean sometging like http://tinymce.moxiecode.com/ Link to comment https://forums.phpfreaks.com/topic/61843-how-can-i-use-js-to-take-a-text-which-is-highlighted-on-a-web-page-as-a-string/#findComment-309958 Share on other sites More sharing options...
lighton Posted July 29, 2007 Share Posted July 29, 2007 just found that it shoudl help http://www.phpfreaks.com/forums/index.php/topic,144579.0.html Link to comment https://forums.phpfreaks.com/topic/61843-how-can-i-use-js-to-take-a-text-which-is-highlighted-on-a-web-page-as-a-string/#findComment-309961 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.