D
D
dizzoid2011-07-19 11:04:23
css
dizzoid, 2011-07-19 11:04:23

Building css selectors based on html

We have to take a tool which thread and get the Question: is there such a tool? or use regular expressions in notepad++ ^)
....
<div id="main">
<div id="logo"> </div>
<div id="middle">
<div id="middle-left">
<div id="menu"> </div>.....

...
#main{ }
#logo{ }
#middle{ }
#menu{ }
#animation{ }
#info_top{ }...


Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Outspector, 2011-07-19
@dizzoid

Make yourself an HTML + jquery page with a form and a couple of lines of code. Even one is enough, which will look something like this:
$("[id]").map(function(i, el) {return "#" + el.id + "{};"}).toArray().join("\n")

C
CAH4A, 2011-07-19
@CAH4A

so I rewrote the above code to Native JS, and now you can bookmark this address:
javascript:var g=[];for(var i in document.all) if(document.all.hasOwnProperty(i) && document.all[i].id) g.push('#'+document.all[i].id); alert(g.join("\n"));
and click on any page to see a list of all id on the page.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question