I have created textarea in my webpage and i also created two buttons (h1) "font-size:40px"and (h4) "font-size:20px" to set the font-size according to selected size in the textarea, when we click the button the font-size of the whole text in textarea changes. But what i mean to do is once if i set the text to 'h1' by clicking the button and again if i want to change the text to 'h4' then previous text should be remain unchanged of size 'h1'(40px) and next what we type after clicking the button 'h4' should be of the size '20px'.
What I mean is, I want the following size of text to be in my textarea box with different size of 40px and 20px
THIS IS TEXT OF SIZE 40PX
THI IS TEXT OF SIZE 20PX
How this is achieved? By using plain javascript or jquery.