diff options
author | Dieter Plaetinck <dieter@plaetinck.be> | 2009-06-06 22:04:09 +0200 |
---|---|---|
committer | Dieter Plaetinck <dieter@plaetinck.be> | 2009-06-06 22:04:09 +0200 |
commit | 1a560cea13685cbb744b759fdc7ee7cb273ccfe9 (patch) | |
tree | b59bb51c4d6cb9d2e38c248c47105a9e39623441 | |
parent | e752dc9376787b2545a0fcdb7594f1ccf1398483 (diff) | |
parent | 488fa0c7963053fb8618fd4322f91b887308173c (diff) |
Merge commit 'scj/master' into experimental
-rw-r--r-- | examples/scripts/linkfollow.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/examples/scripts/linkfollow.js b/examples/scripts/linkfollow.js index b90b82d..a348af9 100644 --- a/examples/scripts/linkfollow.js +++ b/examples/scripts/linkfollow.js @@ -94,9 +94,17 @@ function Hints(){ this.test = test; this.toString = toString; this.numbers = numbers; + function matchAgainst(element){ + if(element.node.nodeName == "INPUT"){ + return element.node.value; + } else { + return element.node.textContent; + } + } function test(element) { // test all the regexp - return words.every(function (regex) { return element.node.textContent.match(regex)}); + var item = matchAgainst(element); + return words.every(function (regex) { return item.match(regex)}); } } |