Javascript Stuff

Tip: Local versus global variables- use the var keyword to declare a variable as local.  

Tip: don’t write this:     var x;   

because x will be undefined. Write this instead: var x = 0; // or some other initial value.

Question: the click method for anchor tags does not appear to work in FireFox. Can anyone confirm this? Here’s a piece of code that fails:
var anchortag = document.getElementsByTagName("a")[0];
anchortag.click();

Leave a Reply