From 3e62e819823a5dbc509e9252836a5b7e64c3e1aa Mon Sep 17 00:00:00 2001 From: retep998 Date: Thu, 7 Mar 2013 13:19:46 -0500 Subject: [PATCH] Moved the javascript to a separate file. Signed-off-by: retep998 --- test.html | 15 ++------------- test.js | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 13 deletions(-) create mode 100644 test.js diff --git a/test.html b/test.html index d3a257f..c475492 100644 --- a/test.html +++ b/test.html @@ -2,25 +2,14 @@ What is this I don't even. +

Sup?

- This is a link to google + Click me to analyze the page.
- \ No newline at end of file diff --git a/test.js b/test.js new file mode 100644 index 0000000..7e07008 --- /dev/null +++ b/test.js @@ -0,0 +1,17 @@ +function analyze() { + var all = document.getElementsByTagName("*"); + for (var i = 0; i < all.length; ++i) { + var info = new Array(); + var validtags = ["A", "BUTTON", "FORM", "IMG", "INPUT", "LINK", "OPTION", "SELECT", "TABLE", "TEXTAREA"]; + if (validtags.indexOf(all[i].tagName) < 0) continue; + info[0] = all[i].tagName; + info[1] = all[i].getAttribute("id"); + info[2] = all[i].getAttribute("name"); + info[3] = all[i].getAttribute("class"); + info[4] = all[i].getAttribute("type"); + dostuff(info); + } +} +function dostuff(info) { + alert(JSON.stringify(info)); +} \ No newline at end of file