1a6620 No.3775
I need help. I am working on a text editor for mobile and its a hybrid app, so its made with web technology. Everything is fine and all until I want to make a button that bolds future text, kind of like in Word. But I can only find one that makes everytext in the text area bold. This is not what I want. I cant find any help on how to do this in Javascript/Jquery on the internet.
This is what I have with jquery and jquery mobile:
$("#bold").on("tap",function(){
$(".editor").toggleClass("bold");
});
It makes every text in the editor bold. I want to make only future text bold.
Can someone help me?
Thank you
____________________________
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
1a6620 No.3777
>text editor
>bold
well you're off to a bad start.
In order to do this, you can't have a single text area. when the user clicks bold you need to add a new DOM element with a bold style, and you need to handle mouse-clicks, arrow movement, selections, etc., to make your dense list of DOM elements function like a single area. it's a tremendous amount of work for literally no payoff: your users would be just as happy typing [b]blah[/b]
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
1a6620 No.3778
>>3777
Ahh so what your saying is when a user clicks the bold button, I'll need to replace the text area in the background? That sounds like a lot of extra work but nothing too bad to be honest.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.