Tuesday, May 3, 2011

JavaScript Find all Elements of an object

To find All functions and variables of a Javascript class or object you can use the following function. It's a silly little Function

function getObj(obj){ 

  var html = '';  

  for (var key in obj){

  html +=   (key + '  -- > '+ typeof obj[key]); 

  
}        

 return html;  

  }

You Can test the function here. Select a default Object and you will see the object elements. If You are using firefox you may seem nothing when you select the document object.






No comments:

Post a Comment

About Me

Web Developer From Dhaka, Bangladesh.