Is it possible to diversify the font size only in some parts of the text in a textarea with Javascript?
custom_button.onclick = function () {
// IE version
if (document.selection != undefined)
{
component_name.focus();
var sel_ie = document.selection.createRange();
textNew = sel_ie.text;
}
// Mozilla version
else
{
var startPos = document.getElementById(component_name).selectionStart;
var endPos = document.getElementById(component_name).selectionEnd;
textNew = document.getElementById(component_name).value.substring(startPos, endPos);
}
var finalText = text.substr(0,startPos) + '<font size="100">' + textNew + '</font>' + text.substr(endPos);
}
When I usually write the code above I achieve the following result into the textarea:
This <font size="100">is the</font> text