Link to home
Start Free TrialLog in
Avatar of michaelshavel
michaelshavel

asked on

How to print out variables in Javascript for debugging

Hi,
I'm pretty new to Javascript but I do have a programming background.
I have a script from a book (on Ajax) that doesn't work, which isn't much of a surprise since half the scripts in this books source code don't work (Ajax for Dummies).

Anyway, I'm printing out variables using an alert statement but when I get to the statement below the message I get back is "[objectHTMLCollection]".  Can someone tell me how I can print out the contents of that object?

-- Snip --
options = xmlDocument.getElementsByTagName("option");
alert(options);
---


Thanks!

M
ASKER CERTIFIED SOLUTION
Avatar of hielo
hielo
Flag of Wallis and Futuna image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of michaelshavel
michaelshavel

ASKER

Thank you both!
Your welcome!  I'm glad I could assist.  Thanks for the grade, the points and the fun question.

bol