Latest web development tutorials
 

HTML DOM Base Object


Base Object

The Base object represents an HTML <base> element.

Access a Base Object

You can access a <base> element by using getElementById():

Example

var x = document.getElementById("myBase");
Try it Yourself »

Create a Base Object

You can create a <base> element by using the document.createElement() method:

Example

var x = document.createElement("BASE");
Try it Yourself »

Base Object Properties

Property Description
href Sets or returns the value of the href attribute in a base element
target Sets or returns the value of the target attribute in a base element

Standard Properties and Events

The Base object also supports the standard properties and events.


Related Pages

HTML reference: HTML <base> tag