Found 10483 Articles for Web Development

HTML DOM Label Object

AmitDiwan
Updated on 30-Jul-2019 22:30:26

211 Views

The HTML DOM Label Object in HTML represents the element.SyntaxFollowing is the syntax −Creating a elementvar labelObject = document.createElement(“LABEL”)PropertiesHere, “LabelObject” can have the following properties −PropertyDescriptionControlIt returns the control of the labelformIt returns a reference of enclosing form that contains the labelhtmlForIt returns/sets the value of the for attribute of a labelExampleLet us see an example for Label htmlForproperty − Live Demo Label htmlFor    form {       width:70%;       margin: 0 auto;       text-align: center;    }    * {       padding: 2px;       margin:5px; ... Read More

HTML DOM Label htmlFor Property

AmitDiwan
Updated on 30-Jul-2019 22:30:26

199 Views

The HTML DOM Label htmlFor property returns/sets the value of for attribute.SyntaxFollowing is the syntax −Returning value of for attribute −labelObject.htmlForExampleLet us see an example for Label htmlForproperty − Live Demo Label htmlFor    form {       width:70%;       margin: 0 auto;       text-align: center;    }    * {       padding: 2px;       margin:5px;    }    input[type="button"] {       border-radius: 10px;    } Label-htmlFor Current Editor: Label for attribute set as editor two ... Read More

HTML DOM KeyboardEvent Object

AmitDiwan
Updated on 30-Jul-2019 22:30:26

110 Views

The HTML DOM KeyboardEvent Object represents an event when user presses a key on keyboard.PropertiesHere, “KeyboardEvent” can have the following properties and methods −Property/MethodDescriptionaltKeyIt returns whether the "ALT" key was pressed or notcharCodeIt returns the Unicode character code of the keycodeIt returns the code of the keyctrlKeyIt returns whether the "CTRL" key was pressed or notgetModifierState()It returns true if the specified key is activated and false if inactiveisComposingIt returns whether the state of the event is composing or notkeyIt returns the key value of the key represented by the eventkeyCodeIt returns the Unicode character code of the key that triggered ... Read More

HTML DOM KeyboardEvent shiftKey Property

AmitDiwan
Updated on 30-Jul-2019 22:30:26

104 Views

The HTML DOM KeyboardEvent shiftKey property returns the Boolean value (true/false) corresponding to if shift key was pressed using an event or not.SyntaxFollowing is the syntax −Returning booleanValue −event.shiftKeyExampleLet us see an example for KeyboardEvent shiftKey property − Live Demo KeyboardEvent shiftKey    form {       width:70%;       margin: 0 auto;       text-align: center;    }    * {       padding: 2px;       margin:5px;    }    input[type="button"] {       border-radius: 10px;    } KeyboardEvent-shiftKey Editor: I Dare you ... Read More

HTML DOM KeyboardEvent metaKey Property

AmitDiwan
Updated on 30-Jul-2019 22:30:26

111 Views

The HTML DOM KeyboardEvent metaKey property returns the Boolean value (true/false) corresponding to if meta key was pressed using an event or not.SyntaxFollowing is the syntax −Returning booleanValue −event.metaKeyExampleLet us see an example for KeyboardEvent metaKey property − Live Demo KeyboardEvent metaKey    form {       width:70%;       margin: 0 auto;       text-align: center;    }    * {       padding: 2px;       margin:5px;    }    input[type="button"] {       border-radius: 10px;    } KeyboardEvent-metaKey Editor: I Dare you ... Read More

HTML DOM KeyboardEvent location Property

AmitDiwan
Updated on 30-Jul-2019 22:30:26

117 Views

The HTML DOM KeyboardEvent loaction property returns the number corresponding to location of key pressed on the keyboard.SyntaxFollowing is the syntax −Returning location of pressed key −event.locationNumbersHere, number returned can be the following −numberDescriptions0It represents almost all values on the keyboard. (every key in the middle section of keyboard, eg: ‘Q’, ’\’, ’spacebar’)1It represents the values on the left-keyboard. (every key in the left section of keyboard, eg: ‘left ctrl’, ’left Shift’, ’left alt’)2It represents the values on the right-keyboard. (every key in the right section of keyboard, eg: ‘right ctrl’, ’right Shift’, ’right alt’)3It represents the values on the ... Read More

HTML DOM KeyboardEvent keyCode Property

AmitDiwan
Updated on 30-Jul-2019 22:30:26

82 Views

The KeyboardEvent keyCode property returns the unicode character codes corresponding to character that was pressed using an event.Note − Use key property instead for accurate resultsSyntaxFollowing is the syntax −Returning latest typed character’s keyCode −event.keyCodeExampleLet us see an example for KeyboardEvent keyCode property − Live Demo KeyboardEvent keyCode    form {       width:70%;       margin: 0 auto;       text-align: center;    }    * {       padding: 2px;       margin:5px;    }    input[type="button"] {       border-radius: 10px;    } KeyboardEvent-keyCode ... Read More

HTML DOM KeyboardEvent key Property

AmitDiwan
Updated on 30-Jul-2019 22:30:26

95 Views

The KeyboardEvent key property returns the key identifier corresponding to the key pressed using an event.SyntaxFollowing is the syntax −Returning latest typed character’s identifier −event.keyExampleLet us see an example for KeyboardEvent key property − Live Demo KeyboardEvent key    form {       width:70%;       margin: 0 auto;       text-align: center;    }    * {       padding: 2px;       margin:5px;    }    input[type="button"] {       border-radius: 10px;    } KeyboardEvent-key Fill in the blanks: ... Read More

HTML DOM KeyboardEvent getModifierState( ) Method

AmitDiwan
Updated on 30-Jul-2019 22:30:26

215 Views

The getModifierState() method returns true/false if the provided modifier key was pressed or not.SyntaxFollowing is the syntax −Calling getModifierState() with parameter as modifier keyevent.getModifierState(“modifierKey”)Modifier KeysHere, “modifierKey” can be the following −modifierKeyAltAltGraphCapsLockControlMetaNumLockScrollLockShiftExampleLet us see an example for getModifierState() method − Live Demo KeyboardEvent getModifierState()    form {       width:70%;       margin: 0 auto;       text-align: center;    }    * {       padding: 2px;       margin:5px;    }    input[type="button"] {       border-radius: 10px;    } KeyboardEvent getModifierState( ) Password: ... Read More

HTML DOM KeyboardEvent code Property

AmitDiwan
Updated on 30-Jul-2019 22:30:26

97 Views

The KeyboardEvent code property returns the key identifier corresponding to the key pressed using an event.Note − Use key property instead for accurate resultsSyntaxFollowing is the syntax −Returning latest typed character’s code −event.codeExampleLet us see an example for KeyboardEvent code property − Live Demo KeyboardEvent code    form {       width:70%;       margin: 0 auto;       text-align: center;    }    * {       padding: 2px;       margin:5px;    }    input[type="button"] {       border-radius: 10px;    } KeyboardEvent-code Press a ... Read More

Advertisements