From 550c914f93b12bdca70c0e96aa6fc357c429a82d Mon Sep 17 00:00:00 2001 From: Brandon Carl Date: Tue, 7 Apr 2015 18:28:58 -0400 Subject: [PATCH] Fixes nodevalue deprecation (with appropriate fallbacks). See #76 --- jquery.country-selector.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jquery.country-selector.js b/jquery.country-selector.js index b987f5a..d378f55 100755 --- a/jquery.country-selector.js +++ b/jquery.country-selector.js @@ -101,8 +101,8 @@ THE SOFTWARE. var attrs = {}; var raw_attrs = context.$select_field[0].attributes; for (var i=0; i < raw_attrs.length; i++) { - var key = raw_attrs[i].nodeName; - var value = raw_attrs[i].nodeValue; + var key = raw_attrs[i].name || raw_attrs[i].nodeName; + var value = raw_attrs[i].value || raw_attrs[i].nodeValue; if ( key !== 'name' && key !== 'id' && typeof context.$select_field.attr(key) !== 'undefined' ) { attrs[key] = value; }