Maroof Raini

Maroof Raini

  • 1.3k
  • 453
  • 237.1k

DOM Exception: INVALID_CHARACTER_ERR (5)

Aug 19 2014 3:15 PM
Hi, I am getting error "Microsoft JScript runtime error: DOM Exception: INVALID_CHARACTER_ERR (5)" while trying to open a page, debugger stops at the line highlighted.
 
function createNewFormElement(inputForm, elementName, elementValue) {
    var newElement = document.createElement("<input name='" + elementName + "' type='hidden'>");
    inputForm.appendChild(newElement);
    newElement.value = elementValue;
    return newElement;
}
 
The same code is running well on my other machine and it's a running code on many machines (on same IE version) so I am not supposed to make any change in the code. What could be other possible reason, please assist. I have tried IE9 and and firefox 31.0

Answers (1)