I have some javascript, and either parentNode or previviousElementSibling seems to be breaking in IE8. The code works fine in firefox and IE9. This is the line that's not getting implemented:
$(submitter.parentNode.parentNode.previousElementSibling).children('#mark_as_broken').show();
code is something like
<form><div><input id=mark_as_broken></input></div></form>
<form><div><input id=mark_as_fixed></input></div></form>
where the mark_as_fixed input is the submitter. This works on other browsers.
any ideas which bit of it won't work, and why?
previousElementSibling
is not supported until IE9.http://www.quirksmode.org/dom/w3c_core.html#t84
Here's a function that should work.
Haven't tested it yet.Seems to work.EDIT:
You didn't mention jQuery, but you appear to be using its API. If so, you can just do this:
Based on your markup, it appears as though you should be using
.find()
instead of.children()
.