diff --git a/demos/drawer/permanent-drawer-above-toolbar.html b/demos/drawer/permanent-drawer-above-toolbar.html
index e13807db440..a0c8a884b7f 100644
--- a/demos/drawer/permanent-drawer-above-toolbar.html
+++ b/demos/drawer/permanent-drawer-above-toolbar.html
@@ -183,8 +183,8 @@
Permanent Drawer
var activatedClass = 'mdc-list-item--selected';
document.querySelector('.mdc-drawer').addEventListener('click', function(event) {
var el = event.target;
- while (!el.classList.contains('mdc-list-item') && el) {
- el = el.parentNode;
+ while (el && !el.classList.contains('mdc-list-item')) {
+ el = el.parentElement;
}
if (el) {
var activatedItem = document.querySelector('.' + activatedClass);
diff --git a/demos/drawer/permanent-drawer-below-toolbar.html b/demos/drawer/permanent-drawer-below-toolbar.html
index 01f8cd24569..8f858a3b05f 100644
--- a/demos/drawer/permanent-drawer-below-toolbar.html
+++ b/demos/drawer/permanent-drawer-below-toolbar.html
@@ -175,8 +175,8 @@ Permanent Drawer
var activatedClass = 'mdc-list-item--selected';
document.querySelector('.mdc-drawer').addEventListener('click', function(event) {
var el = event.target;
- while (!el.classList.contains('mdc-list-item') && el) {
- el = el.parentNode;
+ while (el && !el.classList.contains('mdc-list-item')) {
+ el = el.parentElement;
}
if (el) {
var activatedItem = document.querySelector('.' + activatedClass);
diff --git a/demos/drawer/persistent-drawer.html b/demos/drawer/persistent-drawer.html
index 01a9c55dd29..f9c52b9a730 100644
--- a/demos/drawer/persistent-drawer.html
+++ b/demos/drawer/persistent-drawer.html
@@ -165,8 +165,8 @@ Persistent Drawer
var activatedClass = 'mdc-list-item--selected';
document.querySelector('.mdc-drawer__drawer').addEventListener('click', function(event) {
var el = event.target;
- while (!el.classList.contains('mdc-list-item') && el) {
- el = el.parentNode;
+ while (el && !el.classList.contains('mdc-list-item')) {
+ el = el.parentElement;
}
if (el) {
var activatedItem = document.querySelector('.' + activatedClass);
diff --git a/demos/drawer/temporary-drawer.html b/demos/drawer/temporary-drawer.html
index 615cf139f1c..63f586dda57 100644
--- a/demos/drawer/temporary-drawer.html
+++ b/demos/drawer/temporary-drawer.html
@@ -149,8 +149,8 @@ Temporary Drawer
var activatedClass = 'mdc-list-item--selected';
document.querySelector('.mdc-drawer__drawer').addEventListener('click', function(event) {
var el = event.target;
- while (!el.classList.contains('mdc-list-item') && el) {
- el = el.parentNode;
+ while (el && !el.classList.contains('mdc-list-item')) {
+ el = el.parentElement;
}
if (el) {
var activatedItem = document.querySelector('.' + activatedClass);