Hello,
I can't get this to work in IE:
This is what the HTML code looks like:
<p class="red">Red: <input type="text" id="red_input" value="0"></p>
id is in this case: document.getElementById('red_input');
I want to return ONLY the word 'red'. It works great in FF, but not in IE.
function error(id){
var prnt = id.parentNode,
parentColor = prnt.childNodes[0].textContent,
trimmed = parentColor.replace(/\s+/g,'').replace((/\:$/),"").toLowerCase();
return trimmed
}
In FF it returns the string 'red' In IE it returns 'undefined is null or not an object'. I figured that it's the 'textContent' that does not seem to work in IE. Anyone got any suggestions?
Any help much appreciated!