
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
HTML returnValue Event Property
The HTML returnValue event property returns and modify whether the current event is cancelled or not.
Syntax
Following is the syntax −
1. Returning returnValue
event.returnValue
2. Adding returnValue
event.returnValue=”true | false”
Let us see an example of HTML returnValue event property−
Example
<!DOCTYPE html> <html> <head> <style> body { color: #000; height: 100vh; background-color: #FBAB7E; background-image: linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%); text-align: center; } input { width: 200px; height: 2rem; } .msg { font-size: 1.5rem; } </style> </head> <body> <h1>HTML returnValue Event Property Demo</h1> <input type="text" placeholder="Enter your name" onfocus="show(event)"> <p class="msg"></p> <script> function show(event) { document.querySelector('.msg').innerHTML = 'Is onfocus event is active on above input field? ' + event.returnValue; } </script> </body> </html>
Output
Now try to enter value in the input field to make it focus so as to display the value of returnValue event property.
- Related Articles
- HTML cancelable Event Property
- HTML currentTarget Event Property
- HTML defaultPrevented Event Property
- HTML isTrusted Event Property
- HTML view Event Property
- HTML DOM timeStamp Event Property
- HTML DOM Event type Property
- HTML DOM cancelable Event Property
- HTML ononline Event Attribute
- HTML onpageshow Event Attribute
- HTML ondragend Event Attribute
- HTML ondragenter Event Attribute
- HTML ondragleave Event Attribute
- HTML ondrop Event Attribute
- HTML ondragstart Event Attribute

Advertisements