I read here that "self Refers to the current window or form".
Self does not seem to refer to the current form in this case:
<form><input type="text" onkeyup="alert(self.foo.value)" name="foo"></form>
However in this case it works (referring to the window):
<form><input type="text" onkeyup="alert(self.document.forms[0].foo.value)" name="foo"></form>
So when would you use the self
DOM property over just window
?
self
global (window
property) would ever point to a form. It's utter tosh. Maybe they got it confused with whatthis
points to inform onsubmit
. – Anastigmat