diff options
author | keis <keijser@gmail.com> | 2011-05-14 18:36:24 +0200 |
---|---|---|
committer | keis <keijser@gmail.com> | 2011-05-14 19:07:03 +0200 |
commit | b8ba98602eb01975850f0bf26c9efff0ca82e976 (patch) | |
tree | 1f2de6ba909d8a5976120be9e8ea5d058a4385eb /examples | |
parent | c71e5dd642981b7fdf2d644b19e73caf0840adae (diff) |
use instanceof to check element type
Diffstat (limited to 'examples')
-rw-r--r-- | examples/data/scripts/follow.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/examples/data/scripts/follow.js b/examples/data/scripts/follow.js index ced13aa..aa4ed72 100644 --- a/examples/data/scripts/follow.js +++ b/examples/data/scripts/follow.js @@ -135,9 +135,8 @@ uzbl.follow.generateHint = function(doc, el, label, top, left) { // but at least set the href of the link. (needs some improvements) uzbl.follow.clickElem = function(item) { if(!item) return; - var name = item.tagName; - if (name == 'INPUT') { + if (item instanceof HTMLInputElement) { var type = item.type; if (type == 'text' || type == 'file' || type == 'password') { item.focus(); @@ -145,7 +144,7 @@ uzbl.follow.clickElem = function(item) { return "XXXEMIT_FORM_ACTIVEXXX"; } // otherwise fall through to a simulated mouseclick. - } else if (name == 'TEXTAREA' || name == 'SELECT') { + } else if (item instanceof HTMLTextAreaElement || item instanceof HTMLSelectElement) { item.focus(); item.select(); return "XXXEMIT_FORM_ACTIVEXXX"; |