Found 10483 Articles for Web Development

HTML DOM KeyboardEvent charCode Property

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

124 Views

The KeyboardEvent charCode 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 charCode −event.charCodeExampleLet us see an example for KeyboardEvent charCode property − Live Demo KeyboardEvent charCode    form {       width:70%;       margin: 0 auto;       text-align: center;    }    * {       padding: 2px;       margin:5px;    }    input[type="button"] {       border-radius: 10px;    } KeyboardEvent-charCode Fill ... Read More

HTML DOM Kbd Object

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

124 Views

The Kbd Object represents an inline element which displays monospace font by default.SyntaxFollowing is the syntax −Creating a elementvar kbdObject = document.createElement(“KBD”)ExampleLet us see an example for Kbd object element − Live Demo Kbd Object    form {       width:70%;       margin: 0 auto;       text-align: center;    }    * {       padding: 2px;       margin:5px;    }    input[type="button"] {       border-radius: 10px;    } Kbd Object Keyboard Input:    var divDisplay = document.getElementById("divDisplay");    var textSelect = document.getElementById("textSelect");    function convertKBD() {       var kbdObject = document.createElement("KBD");       var kbdText = document.createTextNode(textSelect.value);       kbdObject.appendChild(kbdText);       divDisplay.appendChild(kbdObject);    } OutputThis will produce the following output −Before clicking ‘Check’ button −After clicking ‘Check’ button −

How to display the date and time of a document when it is last modified in JavaScript?

Lokesh Yadav
Updated on 08-Dec-2022 08:04:49

2K+ Views

In this article we are going to discuss how to display the date and time of a document when it is last modified in JavaScript. It is important to know the last updated date and time of a web document, when you read some content on the web, to know whether the web document is latest or outdated. The Document object has lastModified property which returns us the last modified date and time of a document. This is a read-only property. The value of the lastModified property is obtained by the HTTP header from the web server. For people who ... Read More

HTML DOM Italic Object

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

194 Views

The HTML DOM Italic Object represents an element which displays text in italic.SyntaxFollowing is the syntax −Creating an elementvar italicObject = document.createElement(“I”)ExampleLet us see an example for Italic object element − Live Demo Italic Object    form {       width:70%;       margin: 0 auto;       text-align: center;    }    * {       padding: 2px;       margin:5px;    }    input[type="button"] {       border-radius: 10px;    } Italic Object Formatter:    var divDisplay = document.getElementById("divDisplay");    var textSelect = document.getElementById("textSelect");    function convertItalic() {       var italicObject = document.createElement("I");       var italicText = document.createTextNode(textSelect.value);       italicObject.appendChild(italicText);       divDisplay.appendChild(italicObject);    } OutputThis will produce the following output −Before clicking ‘Check’ button −After clicking ‘Check’ button −

How to find the accept-charset and enctype attribute of a form in JavaScript?

Lokesh Yadav
Updated on 08-Dec-2022 08:03:14

424 Views

In this article we are going to discuss how to find the accept-charset and enctype attribute of a form in JavaScript. In HTML, there is a element which has few attributes − input, label, text area, select, name, target. The accept-charset is used to return the set of one or more encoding types for the HTML document. This attribute also specifies the character encodings that are to be used for the form submission. The enctype is used to specify how the form-data is encoded. Using acceptCharset attribute The acceptCharset attribute in JavaScript will display the acceptable charset values. Syntax ... Read More

HTML DOM insertAdjacentHTML( ) Method

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

295 Views

The HTML DOM insertAdjacentHTML() method inserts text string as HTML at a specified position.SyntaxFollowing is the syntax −Calling insertAdjacentHTML() with parameters of positionString and HTML codenode.insertAdjacentHTML(“positionString”, “htmlString”)Position StringsHere, “positionString” can be the following −positionStringDescriptionafterbeginIt inserts htmlString after the beginning of node elementafterendIt inserts htmlString after the node elementbeforebeginIt inserts htmlString before the node elementbeforeendIt inserts htmlString before the end of node elementHtml Stringsand, “htmlString” can be the following −positionStringnew span or This is a new paragraphor any other valid html codeExampleLet us see an example for InsertAdjacentHTML() method − Live Demo insertAdjacentHTML()    form {       ... Read More

HTML DOM ins dateTime Property

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

105 Views

The HTML DOM ins dateTime property returns the date and time for when the text was inserted.SyntaxFollowing is the syntax −Returning string valueinsObject.dateTimeExampleLet us see an example for ins dateTime property − Live Demo ins dateTime    form {       width:70%;       margin: 0 auto;       text-align: center;    }    * {       padding: 2px;       margin:5px;    }    input[type="button"] {       border-radius: 10px;    } ins-dateTime Fact: Water cannot persist on moon's surface. Water ice found on ... Read More

HTML DOM ins cite Property

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

129 Views

The HTML DOM ins cite property returns the URL of a document that reasons why text was inserted.SyntaxFollowing is the syntax −Returning string valueinsObject.citeExampleLet us see an example for ins cite property − Live Demo ins cite    form {       width:70%;       margin: 0 auto;       text-align: center;    }    * {       padding: 2px;       margin:5px;    }    input[type="button"] {       border-radius: 10px;    } ins-cite Fact: Water cannot persist on moon's surface.Water ice found on moon ... Read More

HTML DOM InputEvent Object

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

219 Views

The InputEvent Object represents all the events that correspond to content change of a form element.PropertiesHere, “InputEvent” can have the following properties/methods −Property/MethodDescriptiondataIt returns the string corresponding to inserted characterdataTransferIt returns an object containing information about the interested/deleted datagetTargetRanges()Returns an array containing target ranges that will be affected by the insertion/deletion.inputTypeIt returns the type of inputisComposingIt returns the state of the eventExampleLet us see an example for InputEvent data property − Live Demo InputEvent Data    form {       width:70%;       margin: 0 auto;       text-align: center;    }    * {   ... Read More

HTML DOM InputEvent inputType Property

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

115 Views

The HTML DOM InputEvent inputType property returns the input type of event triggered.SyntaxFollowing is the syntax −Returning latest typed character in text field −event.inputTypeExampleLet us see an example for InputEvent inputTypeproperty − Live Demo InputEvent inputType    form {       width:70%;       margin: 0 auto;       text-align: center;    }    * {       padding: 2px;       margin:5px;    }    input[type="button"] {       border-radius: 10px;    } InputEvent-inputType Action teller:    var divDisplay = ... Read More

Advertisements