Notes on Java, Solaris, PHP, LDAP…

June 20, 2008

Getting all properties and custom attributes of a Javascript object

Filed under: Java — negev @ 5:23 pm
Tags:

I’ve added a custom attribute to <TR> rows of a table and then my code searched over all rows through the values of this attribute. This is how to print all fields of an object:
var attrs= ”;
for( var attr in theObject ) {
attrs+= attr+’, ‘;
}
alert( attrs );
And to get value of a custom attribute (e.g. ‘custom_data’): row.getAttribute(  ‘custom_data’ )

Advertisements

2 Comments »

  1. Thanks for this valuable code

    Comment by Firas Nizam — January 1, 2009 @ 6:38 am | Reply

  2. hello

    Comment by aditya — August 5, 2010 @ 6:46 am | Reply


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: