New course! Every coder should learn Generative AI!
Try a free lesson+ 1
Is there any return type for event attributes.
if there is any return type can we use that event attributes in if statement
2 Answers
+ 4
No. Events don't return anything and therefore don't have a return type.
Events are not functions. Functions have return types. Events are objects with information about events.
Event handlers are functions, though. For an event handler, a return value of false can mean something special but no other type of value makes a difference.
For example:
onsubmit="return false" if you want a form to never really submit.
There is more detail at:
https://developer.mozilla.org/en-US/docs/Archive/Mozilla/XUL/Tutorial/More_Event_Handlers#Prevent_Default_Action
+ 2
now I understand 👍
Thanks for your response 🙂