You have a basic JavaScript DOM API error here.This is not a JavaScript learning group. Please, next time, search for answers through a general search engine (if it also does not work within a regular web page\JavaScript, then it must be unrelated to extensions).
You are trying to call the "replace" method of a DOM element. Only strings (or special\user defined objects) have that "replace" method.
This is the right code -
var something = document.getElementById('else');
something.textContent = something.textContent.replace(",", "");
(No need to append it, it will change the element with this code already.)