Skip to content
Advertisement

Is there a way to change text style on the fly on the next inputted text via a drop down?

So I have made this webpage wherein it is a pseudo RTF editor that inserts data into the database. Insert into php the html in a div

I am having a problem when it comes to text styling the text typed after selecting a text style from a drop down. I would want it to be like word wherein after clicking on a particular text style, it would start typing using that said text style but not affecting rest of the text inside of a div. Codepen

JavaScript

Advertisement

Answer

So I have solved the change font style on the fly problem and but I am still trying to figure out that problem when it comes to anything bigger than 36.

codepen

I added

JavaScript

at the end of my change font script

JavaScript

as for changing the font size, I inserted

JavaScript

at the end of it thus making my change font size script

JavaScript

I am hoping to find a way to increase the font size or some other way than adding document.execCommand("fontSize", false, "7"); at the end of it.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement