JavaScript inline events syntax -
Is there any reason to use one of the following reasons for other reasons:
& Lt; Input type = "button" value = "b1" onclic = "management (click)" /> & Lt; Input type = "button" value = "b2" onclick = "manageClick (this);" / & Gt; & Lt; Input type = "button" value = "b2" onclick = "management (click); return back;" / & Gt; & Lt; Input type = "button" value = "b3" onclick = "return management (this);" / & Gt; & Lt; Input type = "button" value = "b4" onclick = "javascript: click return management (this);" / & Gt;
And please do not give me your valuable time to tell me to use jQuery or attachEvent
/ addEventListener
. This is not really the purpose of my question.
There is no difference between the first two, in this specific position Semicolon is optional.
Any third will stop any default work, which will not do the first two.
Fourth manageClick
Use, AttachEvent
/ addEventListener
- Ducks and Runs )
Comments
Post a Comment