skippt Posted January 14, 2014 Share Posted January 14, 2014 Hi,I'm working on trying to make a string in a textarea bold by inserting bold tags.The script I have can be found below:http://jsfiddle.net/28Bc5/1/The script will insert bold tags but I'm trying to work out a way in which I can remove the bold tags when highlighting.It would have to check whether bold tags are wrapped around the string and then remove them. I'd imagine it would work something like this:If only part of the bold string is highlighted, insert a </b> tag at the beginning and insert of </b> tag at the end of the string.If left side of the bold string is highlighted, remove <b> tag from beginning and move it to the end of the highlighted string.If right side of the bold string is highlighted, remove </b> tag from end and move it to the beginning of highlighted string.Can anyone teach me how I would do this please? Link to comment https://forums.phpfreaks.com/topic/285359-remove-bold-tags-on-highlight/ Share on other sites More sharing options...
Ch0cu3r Posted January 14, 2014 Share Posted January 14, 2014 So you want to remove any bold tags that are within the highlighted string? Link to comment https://forums.phpfreaks.com/topic/285359-remove-bold-tags-on-highlight/#findComment-1465213 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.