HTML DOM Base Object

Base Object

The Base object represents the HTML <base> element.

Access Base Object

You can use getElementById() to access the <base> element:

var x = document.getElementById("myBase");

Try it yourself

Create Base Object

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

var x = document.createElement("BASE");

Try it yourself

Base Object Properties

Properties Description
href Sets or returns the value of the href attribute of the base element.
target Sets or returns the value of the target attribute of the base element.

Standard Properties and Events

The Base Object Supports StandardsPropertiesAndEvents.

Related Pages

HTML Reference Manual:HTML <base> Tag