aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes how to know object type? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "how to know object type?" Watch "how to know object type?" New topic
Author

how to know object type?

ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
We usually get any object in JS like:

document.getElementById('anyId')

How can we know, whcih object it is??

Thanks.

[ June 15, 2006: Message edited by: Bear Bibeault ]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
What do you mean which object? You talking if it is a div or span? Wouldn't you know what it is to begin with?

Eric
[ June 15, 2006: Message edited by: Eric Pascarello ]
Manesh Kumar
Ranch Hand

Joined: Mar 21, 2006
Posts: 94
There is a typeof function in Javascript, but it is not very specific.

If you want what is the element type,

this might help you.


However, I have never found any use of it till now.


Manesh
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to know object type?