I’m curious if there’s a way to style content in a textarea as a user types.
For example:
<textarea>abcdefghijklmnopqrstuvwxyz</textarea>
Could I highlight all the vowels in the above textarea string on screen using javascript? But still only send the string when the form is submitted?
You can use a
divwithcontentEditableattribute instead oftextareaand to do the highlighting there.https://developer.mozilla.org/en-US/docs/HTML/Content_Editable
You will still need to copy the content of this
divto a hidden field of a form if you need to post it.