0

I am getting the value of an input in javascript with this command:

document.getElementById("formula1").value;

I continuously search for a specific substring using indexOf and I am hoping to change the text spacing and italicization of that substring if it is found but leave all other characters alone. Is this possible?

Murey Tasroc
  • 328
  • 2
  • 8
  • You could insert or remove whitespace but it’s not possible to change styling of individual characters within an input field. – Daniel Beck Mar 06 '18 at 00:58

1 Answers1

0

Answer Using a form element such as a text area or textbox is NOT possible to output RTF (Rich Text Format).
However you can mimic a text area or text box by creating a DIV that outputs the text by applying styling rules to various spans within the div.

You can download off the shelf WYSIWYG editors and place the formatting and send the data to be displayed in one of these editors such as http://htmleditor.tools/ which will save you a whole heap of development time.

In terms of converting RTF (Rich Text Format) on HTML Form elements such as a textbox or text area, then this question has been asked before with the same response I have given you.
Click here

DataCure
  • 425
  • 2
  • 15