Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getting all attributes 1

Status
Not open for further replies.

Light777

Programmer
May 15, 2003
32
0
0
US
For testing purposes, I need to create a list of all of the elements on a page that I am working on with all of their attributes and values. Does anyone have a snipet of code that will cycle through every object and get their attributes?

i.e.

document.Form.TextArea.Value = "whatever"
document.Form.Option.Value = 1

etc.
 
If only for testing purposes, you might be interested in my DOM Browser. Instructions on how to use it are on faq216-4345.
Code:
javascript:external.AddFavorite("javascript:void(m=window.open());m.document.write(\"<script>function x(s){var o=eval(s),b='';for(v in o){b+='<tr><td>'+(typeof o[v]=='object' && o[v]!=null?'<A HREF=javascript:top.x(\\\"'+s+(isNaN(v)?'.'+v:'['+v+']')+'\\\")>'+v+'</A>':v)+'</td><td>'+(typeof o[v]=='unknown'?'_':'<xmp>'+o[v]+'</xmp>')+'</td></tr>'}fd=frames[0].document;fd.write('<h3>'+s+'</h3><table border=1>'+b+'</table>');fd.close();}</script><frameset><frame></frameset>\");m.x('opener')","DOM Browser")

Adam
while(ignorance){perpetuate(violence,fear,hatred);life=life-1};
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top