[Solved] Undefined is not a function javascript error [closed]


It’s getElementsByName note the s, document.getElementByName is not defined.

That would get you a nodeList, so

function cleaning() {
    var elem = document.getElementsByName("fitas")[0];

    elem.value = elem.value.replace(/^.+?(<url=[^>]+>).+$/, '$1');
}

Also, the way you’re typing the script tag was popupar in the nineties, these days it’s all lowercase, and you don’t need a language attribute, and in HTML5 you don’t really need a type attribute either.

3

solved Undefined is not a function javascript error [closed]