Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
HTML Articles
Page 19 of 151
HTML DOM HashChangeEvent
The HTML DOM HashChangeEvent is a type of interface used for representing those events that fire whenever the # part of the URL has been modified.PropertiesFollowing are the properties for the HashChangeEvent −PropertyDescriptionnewURLTo return the document URL after the hash has been modified.oldURLTo returns the document URL before the hash was changedSyntaxFollowing is the syntax for HashChangeEvent.event.eventPropertyHere, eventProperty is one of the above two properties.ExampleLet us look at an example for the HashChangeEvent. HashChangeEvent example Change the hash by clicking the below button CHANGE function changeHash() { location.hash = "NEWHASH"; } ...
Read MoreHTML DOM DragEvent
The HTML DOM DragEvent is a type of event that gets executed whenever the selected text is being dragged and dropped. This event was introduced in HTML5.PropertiesFollowing is the property for the HTML DOM DragEvent −PropertyDescriptiondataTransferTo return the data that is being dragged or dropped by the user.SyntaxFollowing is the syntax for DragEvent −Object.DragEventType= function_name;Here, function_name is the function that we want to execute on the event being executed.EventsFollowing are the event types belonging to the DragEvent object −EventDescriptionondragOccurs when an element is being dragged.ondragendOccurs when the element has been finished dragging by the user.ondragenterOccurs when the element enters the ...
Read MoreHTML DOM Heading object
The HTML DOM Heading object is associated with the HTML heading elements ranging from to . Using the heading object we can create and access heading element with the createElement() and getElementById() method respectively.SyntaxFollowing is the syntax for −Creating a Heading object −var p = document.createElement("H1");ExampleLet us look at an example for the Heading object − Heading object example Create a h1 element by clicking the below button CREATE function createH1() { var h = document.createElement("H1"); var txt = document.createTextNode("H1 element has been created"); h.appendChild(txt); ...
Read MoreHTML DOM Input Number type Property
The HTML DOM Input number type property is associated with the input element having its type=”number”. It will always return number for the input number element.SyntaxFollowing is the syntax for number type property −numberObject.typeExampleLet us look at an example for the HTML DOM Input Number type property − Input Number type property PHONE NO: Get the above element type by clicking the below button Get Type function getType() { var t = document.getElementById("NUMBER1").type; document.getElementById("Sample").innerHTML = "The type for the input field is : "+t; } ...
Read MoreHTML DOM Input Number value Property
The HTML DOM Input number value property is associated with the input element having type=”Number” and having the value attribute. This property is used for returning the value of input element value attribute or to set it. This property is used for specifying a default value for elements and it also changes its value to user input.SyntaxFollowing is the syntax for −Setting the value property −numberObject.value = number;Here, number is used for specifying the value for the number field.ExampleLet us look at an example for the input Number value property − Input Number Value property PHONE NO: Get ...
Read MoreHTML DOM Input Password defaultValue Property
The HTML DOM Input Password defaultValue property is used for setting or getting the defaultValue of a password field. The defaultValue of an element is the value assigned to the value attribute. The difference between value property and defaultValue property is that the defaultValue property retains the original default value specified while the value property change based on the user input in the input field.SyntaxFollowing is the syntax to set the defaultValue property −passwordObject.defaultValue = valueHere, “value” is the password field default value.ExampleLet us look at an example for the Input Password defaultValue property − Input Password defaultValue ...
Read MoreHTML DOM Input Password disabled Property
The HTML DOM Input Password disabled property is used for setting or returning whether the password field is disabled or not. It uses boolean values with true representing the element should be disabled and false otherwise. The disabled property is set to false by default. The disabled element is greyed out by default and is unclickable.SyntaxFollowing is the syntax for −Setting the disabled property −passwordObject.disabled = true|false;Here, true=password field is disabled and false=the password field is not disabled. It is false by default.ExampleLet us look at an example for the Input password disabled property − Input Password disabled ...
Read MoreHTML DOM Input Password form Property
The HTML DOM Input Password form property is used for returning the form reference that contains the input password field. If the input password field is outside the form then it will simply return NULL. This property is read-only.SyntaxFollowing is the syntax for input password form property.passwordObject.formExampleLet us look at an example for the Input Password form property − Input Password form Property Password: Get the form id by clicking on the below button GET FORM function formId() { var P=document.getElementById("PASS").form.id; document.getElementById("Sample").innerHTML = "The id of ...
Read MoreHTML DOM Input Password name Property
The HTML DOM Input Password name property is used for setting or returning the name attribute of an input password field. The name attribute helps in identifying the form data after it has been submitted to the server. JavaScript can also use the name attribute to refer form elements to manipulate later on.SyntaxFollowing is the syntax for −Setting the name property −passwordObject.name = nameHere, name is for specifying the password field name.ExampleLet us look at an example for the password name property − Input Password name Property Password: Change the name of the password field by clicking ...
Read MoreHTML DOM emphasized object
The HTML DOM emphasized object is associated with the HTML element. The element is used for emphasizing some text and it marks that text in italic. You can create and access emphasized object using createElement() or getElementById() method respectively.SyntaxFollowing is the syntax for −Creating an emphasized object −var e = document.createElement("EM");ExampleLet us look at an example for the emphasized object − emphasized object example Create an em element by clicking the button below CREATE function createEM() { var e = document.createElement("EM"); var txt = document.createTextNode("HELLO WORLD"); ...
Read More