.previousSibling and whitespace

Click

This gives an '[object Text]', because of the whitespace between </li> and <li>.


Click

Here there isn't any whitespace, so you get the HTMLLIElement. There is no whitespace in the source file.


Internet Explorer

IE gives the LI in both examples.


Home - More stuff