Is there any return type for event attributes. | Sololearn: Learn to code for FREE!
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

11th Sep 2020, 6:59 PM
Bhargava Ram
Bhargava Ram - avatar
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
12th Sep 2020, 4:40 AM
Josh Greig
Josh Greig - avatar
+ 2
now I understand 👍 Thanks for your response 🙂
12th Sep 2020, 2:44 PM
Bhargava Ram
Bhargava Ram - avatar