HTML DOM Form Object

Form Object The Form object represents an HTML <form> element. Access a Form Object You can access a <form> element by using getElementById(): Example var x = document.getElementById(“myForm”); Try it Yourself » Tip: You can also access a <form> element by using the forms collection. Create a Form Object You can create a <form> element by using the document.createElement() […]

HTML DOM Div Object

Div Object The Div object represents an HTML <div> element. Access a Div Object You can access a <div> element by using getElementById(): Example var x = document.getElementById(“myDIV”); Try it Yourself » Create a Div Object You can create a <div> element by using the document.createElement() method: Example var x = document.createElement(“DIV”); Try it Yourself » Div […]

HTML DOM Caption Object

Caption Object The Caption object represents an HTML <caption> element. Access a Caption Object You can access a <caption> element by using getElementById(): Example var x = document.getElementById(“myCaption”); Try it Yourself » Create a Caption Object You can create a <caption> element by using the document.createElement() method: Example var x = document.createElement(“CAPTION”); Try it Yourself » Tip: You […]