Removed all references to node.parentElement (IE compatibility)

Internet Explorer 11 does not support this property on HTML nodes.