I have been using DOM methods to insert html elements routinely and dependably
but I am now working on a project that is supposed to replace a textarea element
with a span tag that contains the content entered into the textarea.
this is what is inserted into the document by the htmlElement.appendChild method.
The span tag would be a child node of a pre tag.
The point is to be able to convert the span tag back to a textarea element for editing
the text. That is the purpose of the span tag: to get text contained in it.
Is there some recent security problem with inserting span tags using DOM methods?
I am working on MacOS Sequoia and Firefox 133.x. But the same issue shows up in Safari on the
same system.
but I am now working on a project that is supposed to replace a textarea element
with a span tag that contains the content entered into the textarea.
JavaScript:
case 'TEXTAREA':
var holdOver = e.target.value;
var holdOverId = e.target.id.split('-');
var keyStr = holdOverId[0];
var seq = holdOverId[1];
var parent = e.target.parentNode;
e.target.parentNode.removeChild(e.target);
parent.appendChild(mkElem({'type':"span", 'props':{'id':keyStr+'-0'}})); //<<<<<<<
hostList[keyStr+'-0'].appendChild(textNode(holdOver)); // <<<<<<
document.getElementById(keyStr+'-group-'+seq).disabled = false;
break;
this is what is inserted into the document by the htmlElement.appendChild method.
HTML:
<undefined id="WE-0">x</undefined>
The span tag would be a child node of a pre tag.
The point is to be able to convert the span tag back to a textarea element for editing
the text. That is the purpose of the span tag: to get text contained in it.
Is there some recent security problem with inserting span tags using DOM methods?
I am working on MacOS Sequoia and Firefox 133.x. But the same issue shows up in Safari on the
same system.
Last edited by a moderator: