Replace uses of parentElement with parentNode

Since in Google Apps parentElement isn't defined.