On the W3 tutorial, it shows htis code:
First of all, W3Schools has nothing to do with W3. Their tutorials were pretty horrible before people started complaining and their confusing name implies that they are somehow connected to W3, but in reality they aren't.
Second of all, this method is not needed anymore. There are no used browsers that don't support JS cleanly (links
, lynx
, etc. have no troubles with JS code whatsoever).
That being said, the code is supposed to do this: