You must be sure that newWidthValue is in fact an instanceof Number or that it does not equal null or that it does not equal NaN either. parseInt() itself will return a NaN in certain conditions. For instance if:
newWidthValue = 'NOTNUMERIC';
alert(parseInt(newWidthValue )); // will alert with NaN
document.getElementById('obscureDiv').style.width = parseInt(newWidthValue) + 'px'; // will throw "Invalid Argument" error because it will be trying to set the width to 'NaNpx'
adding child nodes to document
Always appendChild(), replaceChild() or insertBefore() before setting any of the new element's attributes: