Hi guys, been working on this problem for a while now and Im exhausted.
I understand that the 'For In' loop can print out the properties and methods for a given object.
I would like to do this for the 'event' object... Using the code below I am able to extract the properties for the 'navigator' object perfectly:
for (i in navigator) {
document.write("property: " + i);
document.write(" value: " + navigator + "<br>");
}
Now, when I replace navigator with 'event' I get nothing!
for (i in event) {
document.write("property: " + i);
document.write(" value: " + event + "<br>");
}
NOTE: I have also tried window.event
Why is this and what is the correct way to get it working?
thanks for your help guys.
I understand that the 'For In' loop can print out the properties and methods for a given object.
I would like to do this for the 'event' object... Using the code below I am able to extract the properties for the 'navigator' object perfectly:
for (i in navigator) {
document.write("property: " + i);
document.write(" value: " + navigator + "<br>");
}
Now, when I replace navigator with 'event' I get nothing!
for (i in event) {
document.write("property: " + i);
document.write(" value: " + event + "<br>");
}
NOTE: I have also tried window.event
Why is this and what is the correct way to get it working?
thanks for your help guys.