Looping and displaying Element ID's ?????

M

Mel

Can someone help me out please ???

I need to be able to display any and all element ID's with yellow
background whereever they appear on the screen.

Is this possible ?

I will be turning a flag in my URL to instruct the page to display all
emements that have ID associated with them.

Much appreciate it
 
I

Ian Collins

Mel said:
Can someone help me out please ???

I need to be able to display any and all element ID's with yellow
background whereever they appear on the screen.
How is the background set, in the markup or by a CSS style?
Is this possible ?
Just about anything is possible.
 
E

Evertjan.

Mel wrote on 14 feb 2007 in comp.lang.javascript:
Can someone help me out please ???

I need to be able to display any and all element ID's with yellow
background whereever they appear on the screen.

Is this possible ?

No, Ids have no background, only certain elements have.
I will be turning a flag in my URL to instruct the page to display all
emements that have ID associated with them.

<script type='text/javascript'>
var da = document.all;
for (var el=0;el<da.length;el++)
if (da[el].id!='')
da[el].style.backgroundColor = 'yellow';
</script>
 
M

Mel

Mel wrote on 14 feb 2007 in comp.lang.javascript:
Can someone help me out please ???
I need to be able to display any and all element ID's with yellow
background whereever they appear on the screen.
Is this possible ?

No, Ids have no background, only certain elements have.
I will be turning a flag in my URL to instruct the page to display all
emements that have ID associated with them.

<script type='text/javascript'>
var da = document.all;
for (var el=0;el<da.length;el++)
if (da[el].id!='')
da[el].style.backgroundColor = 'yellow';
</script>

Thanks a whole bunch Evertjan;
It does half of what i need and i hope that you can help me out some
more.
What i need is to have the ID of the element displayed in yellow
around the area where the element is seen on the screen.

I need to make a data map of elements and dont want to keep looking at
the HTML code. So the BIG idea was to flip a flag in my url and see a
little YELLOW area with the ID of the element displayed in it.

Appreciate your help
Mel
 
L

-Lost

Evertjan. said:
Mel wrote on 14 feb 2007 in comp.lang.javascript:
Can someone help me out please ???

I need to be able to display any and all element ID's with yellow
background whereever they appear on the screen.

Is this possible ?

No, Ids have no background, only certain elements have.
I will be turning a flag in my URL to instruct the page to display all
emements that have ID associated with them.

<script type='text/javascript'>
var da = document.all;
for (var el=0;el<da.length;el++)
if (da[el].id!='')
da[el].style.backgroundColor = 'yellow';
</script>

It *may* not matter, I am not totally sure, but I would use

document.getElementsByTagName("*") before using document.all

My $0.02.

-Lost
 
E

Evertjan.

Mel wrote on 14 feb 2007 in comp.lang.javascript:
Mel wrote on 14 feb 2007 in comp.lang.javascript:

<script type='text/javascript'>
var da = document.all;
for (var el=0;el<da.length;el++)
if (da[el].id!='')
da[el].style.backgroundColor = 'yellow';
</script>

Thanks a whole bunch Evertjan;
It does half of what i need and i hope that you can help me out some
more.

What you want is not always what you need,
but that could be an English thing?
What i need is to have the ID of the element displayed in yellow
around the area where the element is seen on the screen.

That was not what you asked, but:

da[el].style.border = 'yellow 2px solid';

Hoever you will overwrite a possible earlier style border, and could
compromize the spacial integrity of the page.
I need to make a data map of elements and dont want to keep looking at
the HTML code. So the BIG idea was to flip a flag in my url and see a

A querystring append to the url?
little YELLOW area with the ID of the element displayed in it.

Again another specification? ;-)

If ony you yourself use it as a development tool, why not use an existing
one, like the free Firefox include "web developer toolbar"?

I use that more often than not.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top