HTMLLabelElement.accessKey

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlLabelObj.accessKey

Description

The accessKey property of the HTMLLabelElement object is a single character access key to give access to the form control.

Example

Listing 11.189 illustrates the creation of an HTMLLabelElement using the HTMLBodyElement object and then setting its accessKey property.

Listing 11.189 Creating an HTMLLabelElement and Setting Its accessKey Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var labelObj = formObj.createElement("label");
labelObj.accessKey = "L";

 // -->
</html>

HTMLLabelElement.form

JavaScript 1.5+, JScript 5+

Nav6+, IE5

  

Syntax

htmlLabelObj.form

Description

The form property of the HTMLLabelElement returns the FORM element containing this control. Returns Null if this control isn’t within the context of a form.

Example

Listing 11.190 illustrates the creation of an HTMLLabelElement using the HTMLFormElement object and then reading its form property.

Listing 11.190 Creating an HTMLLabelElement and Reading Its form Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var labelObj = formObj.createElement("label");
if(labelObj.form.Name == "emailForm")
  processEmailForm(labelObj.form);
// -->
</html>

HTMLLabelElement.htmlFor

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlLabelObj.htmlFor

Description

The htmlFor property of the HTMLLabelElement object links this label with another form control by the id attribute.

Example

Listing 11.191 illustrates the creation of an HTMLLabelElement using the HTMLFormElement object element and then setting its htmlFor property.

Listing 11.191 Creating an HTMLLabelElement and Setting Its htmlFor Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var labelObj = formObj.createElement("label");
var inputObj = formObj.createElement("input");
inputObj.name = "address";
labelObj.htmlFor = "address";
// -->
</html>

HTMLLegendElement

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

Core DOM HTML object.

Description

This object represents a caption for a FIELDSET grouping. HTMLLegendElement inherits all properties and methods of the HTMLElement object. Table 11.21 contains a list of properties for this object.

Table 11.21 Properties of theHTMLLegendElement Object

Image

Example

Listing 11.192 illustrates the creation of an HTMLLegendElement using the HTMLFormElement object.

Listing 11.192 Creating an HTMLLegendElement

<html>
<script language="JavaScript"
type="text/javascript">
<!--
var legendObj = formObj.createElement("legend");
// -->
</html>

HTMLLegendElement.accessKey

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlLegendObj.accessKey

Description

The accessKey property of the HTMLLegendElement object is a single character access key to give access to the form control.

Example

Listing 11.193 illustrates the creation of an HTMLLegendElement using theHTMLFormElement object and then setting its accessKey property.

Listing 11.193 Creating an HTMLLegendElement and Setting Its accessKey Property

<html>
<script language="JavaScript" type="text/javascript"> 
<!--
var legendObj = formObj.createElement("legend");
legendObj.accessKey = "L";
// -->
</html>

HTMLLegendElement.align

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlLegendObj.align

Description

The align property of the HTMLLegendElement object is the text alignment relative toFIELDSET.

Example

Listing 11.194 illustrates the creation of an HTMLLegendElement using theHTMLFormElement object and then setting its align property.

Listing 11.194 Creating an HTMLLegendElement and Setting align Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var legendObj = formObj.createElement("legend");
legendObj.align = "top";
// -->
</html>

HTMLLegendElement.form

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlLegendObj.form

Description

The form property of the HTMLLegendElement object returns the form element containing this control. Returns Null if this control isn’t within the context of a form.

Example

Listing 11.195 illustrates the creation of an HTMLLegendElement using theHTMLFormElement object and then reading its form property.

Listing 11.195 Creating an HTMLLegendElement and Reading Its form Property

<html>
<script language="JavaScript"
type="text/javascript">
<!--
var legendObj = formObj.createElement("legend");
if(legendObj.form.Name == "emailForm")
  processEmailForm(legendObj.form);
// -->
</html>

HTMLLIElement

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

Core DOM HTML object.

Description

This object represents an HTML list item element. HTMLLIElement inherits all properties and methods of HTMLElement. Table 11.22 contains a list of properties for this object.

Table 11.22 Properties of theHTMLLIElement Object

Image

Example

Listing 11.196 illustrates the creation of anHTMLLIElement using the HTMLOLElementobject.

Listing 11.196 Creating an HTMLLIElement

<html>
<script language="JavaScript" type="text/javascript">
<!--
var olObj = bodyObj.CreateElment("ol");
var liObj = olObj.createElement("li");
liObj.type = "item";
// -->
 </script>
</html>

HTMLLIElement.type

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlLIObj.type

Description

The type property of the HTMLLIElement object is the list item bullet style.

Example

Listing 11.197 illustrates the creation of an HTMLLIElement using the HTMLOLElementobject and then setting its type property.

Listing 11.197 Creating an HTMLLIElement and Setting Its type Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var olObj = bodyObj.CreateElement("ol");
var liObj = olObj.createElement("li");

liObj.type = "item";
// -->
</script>
</html>

HTMLLIElement.value

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlLIObj.value

Description

The value property of the HTMLLIelement object resets the sequence number when used in OL.

Example

Listing 11.198 illustrates the creation of an HTMLLIElement using the HTMLOLElementobject and then setting its value property.

Listing 11.198 Creating an HTMLLIElement and Setting Its value Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var olObj = bodyObj.CreateElment("ol");
var liObj = olObj.createElement("li");
liObj.value = "list item text";
// -->
</script>
</html>

HTMLLinkElement

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

Core DOM HTML object.

Description

The LINK element specifies a link to an external resource, and defines this document’s relationship to that resource (or vice versa). Table 11.23 contains a list of properties for this object.

Table 11.23 Properties of the HTMLLinkElement Object

Image

Example

Listing 11.199 illustrates the creation of an HTMLLinkElement using the HTMLDocumentobject element and then setting its href property.

Listing 11.199 Creating an HTMLLinkElement and Setting Its href Property

<html>
<script language="JavaScript" type="text/javascript"> 
<!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc");
htmlDoc.open(); var linkElement = htmlDoc.createElement("link");
linkElement.href = "http://foo.bar/ "; }
</html>

HTMLLinkElement.charset

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlLinkObj.charset

Description

The charset property of the HTMLLinkElement object is the character encoding of the resource being linked to.

Example

Listing 11.200 illustrates the creation of and displaying the charset property of a HTMLLinkElement object.

Listing 11.200 Displaying the charset Property of HTMLLinkElement

<html>
<script language="JavaScript" type="text/javascript">
 <!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc"); htmlDoc.open();
var linkElement =
htmlDoc.createElement("link"); htmlDoc.Write(linkElement.charSet);
}
</html>

HTMLLinkElement.disabled

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

Syntax

htmlLinkObj.disabled

Description

The disabled property of the HTMLLinkElement enables/disables the link. This is currently only used for style sheet links, and can be used to activate or deactivate style sheets.

Example

Listing 11.201 illustrates the creation of an HTMLLinkElement using the HTMLDocument object element and then setting its disabled property to true.

Listing 11.201 Creating an HTMLLinkElement and Setting Its disabled Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc");
htmlDoc.open();
var linkElement = htmlDoc.createElement("link");
linkElement.disabled = true;
}
</html>

HTMLLinkElement.href

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlLinkObj.href

Description

The href property of the HTMLLinkElement object is the URI of the linked resource.

Example

Listing 11.202 illustrates the creation of an HTMLLinkElement using the HTMLDocument object element and then setting its href property.

Listing 11.202 Creating an HTMLLinkElement and Setting Its href Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc");
htmlDoc.open();
var linkElement = htmlDoc.createElement("link");
linkElement.href = "http://foo.bar/ ";
}
</html>

HTMLLinkElement.hreflang

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlLinkObj.hreflang

Description

The hrefLang property of the HTMLLinkElement is the language code of the linked resource.

Example

Listing 11.203 illustrates the creation of an HTMLLinkElement using the HTMLDocument object element and then setting its href and hreflang properties.

Listing 11.203 Creating an HTMLLinkElement and Setting Its href and hreflang Properties

<html>
<script language="JavaScript" type="text/javascript">
<!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc");
htmlDoc.open();
var linkElement = htmlDoc.createElement("link");
linkElement.href = "http://foo.bar/ ";
linkElement.hreflang = "us/english";
}
</script>
</html>

HTMLLinkElement.media

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlLinkObj.media

Description

The media property of the HTMLLinkgElement object is designed for use with one or more target media.

Example

Listing 11.204 illustrates the creation of a HTMLLinkElement and setting its media property.

Listing 11.204 Setting an HTMLLinkElement ’s media Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc");
htmlDoc.open();
var linkElement = htmlDoc.createElement("link");
linkElement.media = "image/jpg";
</script>
</html>

HTMLLinkElement.rel

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlLink.rel

Description

The rel property of the HTMLLinkElement object is the forward link type.

Example

Listing 11.205 illustrates setting the rel property of the HTMLLinkElement object

Listing 11.205 Setting the rel property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc");
htmlDoc.open();
var linkElement = htmlDoc.createElement("link");
linkElement.href = "http://foo.bar/ ";
linkElement.rel = "http://foo.bar/link.html";
}
</script>
</html>

HTMLLinkElement.rev

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlLinkObj.rev

Description

The rev property of the HTMLLinkElement object is the reverse link type.

Example

Listing 11.206 illustrates setting of the rev property of the HTMLLinkElement object.

Listing 11.206 Setting the rev property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc");
htmlDoc.open();
var linkElement = htmlDoc.createElement("link");
linkElement.rev = "http://foo.bar/links.htm";
</script>
</html>

HTMLLinkElement.target

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlLinkObj.target

Description

The target property of the HTMLLinkElement object is the frame to render the resource in.

Example

Listing 11.207 illustrates the creation of an HTMLLinkElement using the HTMLDocument object element and setting its target property.

Listing 11.207 Creating an HTMLLinkElement and Setting Its target Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc");
htmlDoc.open();
var linkElement = htmlDoc.createElement("link");
htmlDoc.write(linkElement.target);
}
// -->
</script>
</html>

HTMLLinkElement.type

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlLinkObj.type

Description

The type property of the HTMLLinkElement object is the advisory content type.

Example

Listing 11.208 illustrates the creation of an HTMlLinkElement using the HTMLDocument object element and then setting its type property.

Listing 11.208 Creating an HTMLLinkElement and Setting Its type Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc");
htmlDoc.open();
var linkElement = htmlDoc.createElement("link");
linkElement.type = "text/html";
// -->
</script>
</html>

HTMLMapElement

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

Core DOM HTML object.

Description

This object represents an HTML element for a client-side image map. The HTMLMapElement object inherits all methods and properties of the HTMLElement object. Table 11.24 contains a list of properties for this object.

Table 11.24 Properties of theHTMLMapElement Object

Image

Example

Listing 11.209 illustrates the creation of an HTMLMapElement using the HTMLBodyElement object.

Listing 11.209 Creating an HTMLMapElement

<html>
<script language="JavaScript" type="text/javascript">
<!--
var mapObj = bodyObj.createElement("map");

// -->
</html>

HTMLMapElement.areas

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlMapObj.areas

Description

The areas property of the HTMLMapElement object is the list of areas defined for the image map are contained in an HTMLCollection.

Example

Listing 11.210 illustrates the creation of an HTMLMapElement using the HTMLBodyElement object and then reading its areas property.

Listing 11.210 Creating an HTMLMapElement and Reading Its areas Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var mapObj = bodyObj.createElement("map");
var areaCollection = mapObj.areas;
// -->
</html>

HTMLMapElement.name

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlMapObj.name

Description

The name property of the HTMLMapElement object names the map (for use with UseMap).

Example

Listing 11.211 illustrates the creation of an HTMLMapElement using the HTMLBodyElement object and then setting its name property.

Listing 11.211 Creating an HTMLMapElement and Setting Its name Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var mapObj = bodyObj.createElement("map");
mapObj.name = "mymap";
// -->
</html>

HTMLMenuElement

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

Core DOM HTML object.

Description

This object represents an HTML menu element. The property for this object is as follows:

Item

Description

compact

Reduces line spacing between list items when true

Example

Listing 11.212 illustrates the creation of an HTMLMenuElement using the HTMLBodyElement.

Listing 11.212 Creating an HTMLMenuElement

<html>
<script language="JavaScript" type="text/javascript">
<!--
var menuObj = bodyObj.createElement("menu");

// -->
</script>
</html>

HTMLMenuElement.compact

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlMenuObj.compact

Description

The compact property of the HTMLMenuElement object indicates whether or not to reduce spacing between list items.

Example

Listing 11.213 illustrates the creation of an HTMLMenuElement using the HTMLBodyElement object and then setting its compact property.

Listing 11.213 Creating an HTMLMenuElement and Setting Its compact Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var menuObj = bodyObj.CreateElement("menu");
menuObj.compact = true;
// -->
</script>
</html>

HTMLMetaElement

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

Core object represents DOM HTML object.

Description

This object represents generic meta-information about the document.HTMLMetaElement inherits all properties and methods from HTMLElement. Table 11.25 contains a list of properties for this object.

Table 11.25 Properties of theHTMLMetaElement Object

Image

Example

Listing 11.214 illustrates the creation of an HTMLMetaElement using the HTMLDocument object.

Listing 11.214 Creating an HTMLMetaElement

<html>
<script language="JavaScript" type="text/javascript">
<!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc");
htmlDoc.open();
var linkElement = htmlDoc.createElement("meta");
}
// -->
</script>
</html>

HTMLMetaElement.content

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlMetaDataObj.content

Description

The content property of the HTMLMetaDataElement object represents associated information contained in the metadata.

Example

Listing 11.215 illustrates the creation of an HTMLMetaElement using the HTMLDocument object element and then setting its content property.

Listing 11.215 Creating an HTMLMetaElement and Setting Its content Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc");
htmlDoc.open();
var metaElement = htmlDoc.createElement("meta");
metaElement.content = "text/html";
}
// -->
</script>
</html>

HTMLMetaElement.httpEquiv

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlMetaDataObj.httpEquiv

Description

The httpEquiv property of the HTMLMetaElement object is the HTTP response header name.

Example

Listing 11.216 illustrates the creation of an HTMLMetaElement using the HTMLDocument object element and then setting its httpEquiv property.

Listing 11.216 Creating an HTMLMetaElement and Setting Its httpEquiv Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc");
htmlDoc.open();
var metaElement = htmlDoc.createElement("meta");
metaElement.httpEquiv = "NO-CACHE";
}
// -->
</script>
</html>

HTMLMetaElement.name

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlMetaDataObj.name

Description

The name property of the HTMLMetaDataElement object is the meta information name.

Example

Listing 11.217 illustrates the creation of an HTMLMetaElement using the HTMLDocument object element and then setting its name property.

Listing 11.217 Creating an HTMLMetaElement and Setting Its name Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc");
htmlDoc.open();
var metaElement = htmlDoc.createElement("meta");
metaElement.name = "keywords";
}
// -->
</script>
</html>

HTMLMetaElement.scheme

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlMetaDataObj.scheme

Description

The scheme property of the HTMLMetaElement object is the select form of content.

Example

Listing 11.218 illustrates the creation of an HTMLMetaElement using the HTMLDocument object element and then setting its scheme property.

Listing 11.218 Creating an HTMLMetaElement and Setting Its scheme Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc");
htmlDoc.open();
var metaElement = htmlDoc.createElement("meta");
metaElement.scheme  = "foo";
}
// -->
</script>
</html>

HTMLModElement

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

Core DOM HTML object.

Description

This object represents a notice of modification to part of a document. The HTMLModElement object inherits all methods and properties from HTMLElement. Table 11.26 contains a list of properties for this object.

Table 11.26 Properties of the HTMLModElement Object

Image

Example

Listing 11.219 illustrates the creation of an HTMLModElement using the HTMLBodyElement object.

Listing 11.219 Creating an HTMLModElement

<html>
<script language="JavaScript" type="text/javascript">
<!--
var modObj = bodyObj.CreateElement("mod");

 // -->
</script>
</html>

HTMLModElement.cite

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlModObj. cite

Description

The cite property of the HTMLModElement object is a URI designating a document that describes the reason for the change.

Example

Listing 11.220 illustrates the creation of an HTMLModElement using the HTMLBodyElement object element and then setting its cite property.

Listing 11.220 Creating an HTMLModElement and Setting Its cite Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var modObj = bodyObj.createElement("mod");
modObj.cite = "http://foo.bar/reference.html";
// -->
</script>
</html>

HTMLModElement.dateTime

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlModObj. dateTime

Description

The dateTime property of the HTMLModElement is the date and time of the change.

Example

Listing 11.221 illustrates the creation of an HTMLModElement using the HTMLBodyElement object and then setting its dateTime property.

Listing 11.221 Creating an HTMLModElement and Setting Its dateTime Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var modObj = bodyObj.CreateElement("mod");
modObj.cite = "http://foo.bar/reference.html";
modObj.dateTime = "2/14/2001";
// -->
</script>
</html>

HTMLObjectElement

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

Core DOM HTML object.

Description

This object represents an HTML object element. The HTMLObjectElement object inherits all methods and properties from the HTMLElement object. Table 11.27 contains a list of properties for this object.

Table 11.27 Properties of the HTMLObjectElement Object

Image

Example

Listing 11.222 illustrates the creation of an HTMLObjectElement using the HTMLBodyElement object and then reading its form property.

Listing 11.222 Creating an HTMLObjectElement and Reading Its form Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var objectObj = bodyObj.createElement("object");
if(objectObj.Form.Name == "emailForm")
  processEmailForm(objectObj.form);
// -->
</script>
</html>

HTMLObjectElement.align

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlObjectObj.align

Description

The align property of the HTMLObjectElement object aligns this object (vertically or horizontally) with respect to its surrounding text.

Example

Listing 11.223 illustrates the creation of an HTMLObjectElement using the HTMLBodyElement object and then setting its align property.

Listing 11.223 Creating an HTMLObjectElement and Setting Its align Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var objectObj = bodyObj.createElement("object");
objectObj.align = "top";
// -->
</script>
</html>

HTMLObjectElement.archive

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlObjectObj.archive

Description

The archive property of the HTMLObjectElement object is the space-separated list of archives.

Example

Listing 11.224 illustrates the creation of an HTMLObjectElement using the HTMLBodyElement object and then setting its archive property.

Listing 11.224 Creating an HTMLObjectElement and Setting Its archive Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var objectObj = bodyObj.createElement("object");
objectObj.archive = "foo.jar";
// -->
</script>
</html>

HTMLObjectElement.border

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlObjectObj.border

Description

The border property of the HTMLObjectElement object is the width of border around the object.

Example

Listing 11.225 illustrates the creation of an HTMLObjectElement using the HTMLBodyElement object and then setting its border property.

Listing 11.225 Creating an HTMLObjectElement and Setting Its border Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var objectObj = bodyObj.createElement("object");
objectObj.border = 0;
// -->
</script>
</html>

HTMLObjectElement.code

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlObjectObj.code

Description

The code property of the HTMLObjectElement object is an applet class file. See the code attribute for HTMLAppletElement.

Example

Listing 11.226 illustrates the creation of an HTMLObjectElement using the HTMLBodyElement object and then setting its code property.

Listing 11.226 Creating an HTMLObjectElement and Setting Its code Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var objectObj = bodyObj.createElement("object");
objectObj.code = "classId";
// -->
</script>
</html>

HTMLObjectElement.codeBase

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlObjectObj.codeBase

Description

The codeBase property of the HTMLObjectElement object is the base URI for classid, data, and archive attributes.

Example

Listing 11.227 illustrates the creation of an HTMLObjectElement using the HTMLBodyElement object and then setting its codeBase property.

Listing 11.227 Creating an HTMLObjectElement and Setting Its codeBase Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var objectObj = bodyObj.createElement("object");
objectObj.codeBase = "http://foo.bar/scripts/";
// -->
</script>
</html>

HTMLObjectElement.codeType

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlObjectObj.codeType

Description

The codeType property of the HTMLObjectElement is the content type for data downloaded via classid attribute.

Example

Listing 11.228 illustrates the creation of an HTMLObjectElement using the HTMLBodyElement object and then setting its codeType property.

Listing 11.228 Creating an HTMLObjectElement and Setting Its codeType Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var objectObj = bodyObj.createElement("object");
objectObj.codeType = "x-application/flash";
// -->
</script>
</html>

HTMLObjectElement.contentDocument

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlObjectObj.contentDocument

Description

The contentDocument property of the HTMLObjectElement is the document this object contains, if there is any and it is available, or Null otherwise.

Example

Listing 11.229 illustrates the creation of an HTMLObjectElement using the HTMLBodyElement object and then reading its contentDocument property.

Listing 11.229 Creating an HTMLObjectElement and Setting Its contentDocument Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var htmlDoc = objectObj.contentDocument;
// -->
</script>
</html>

HTMLObjectElement.data

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlObjectObj.data

Description

The data property of the HTMLObjectElement object is a URI specifying the location of the object’s data.

Example

Listing 11.230 illustrates the creation of an HTMLObjectElement using the HTMLBodyElement object.

Listing 11.230 Creating an HTMLObjectElement

<html>
<script language="JavaScript" type="text/javascript">
<!--
var objectObj = bodyObj.createElement("object");

 // -->
</script>
</html>

HTMLObjectElement.declare

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlObjectObj.declare

Description

The declare property of the HTMLObjectElement object declares (for future reference), but does not instantiate, this object.

Example

Listing 11.231 illustrates the creation of an HTMLObjectElement using the HTMLBodyElement object and then setting its declare property.

Listing 11.231 Creating an HTMLObjectElement and Setting Its declare Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var objectObj = bodyObj.createElement("object");
objectObj.declare = true;
// -->
</script>
</html>

HTMLObjectElement.form

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlObjectObj.form

Description

The form property of the HTMLObjectElement object returns the FORM element containing this control. Returns Null if this control isn’t within the context of a form.

Example

Listing 11.232 illustrates the creation of an HTMLObjectElement using the HTMLBodyElement object element and then reading its form property.

Listing 11.232 Creating an HTMLObjectElement and Reading Its form Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var objectObj = bodyObj.createElement("object");
if(objectObj.form.name == "emailForm")
  processEmailForm(objectObj.form);
// -->
</script>
</html>

HTMLObjectElement.height

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlObjectObj.height

Description

The height property of the HTMLObjectElement object overrides the height.

Example

Listing 11.233 illustrates the creation of an HTMLObjectElement using the HTMLBodyElement object and then setting its height property.

Listing 11.233 Creating an HTMLObjectElement and Setting Its height Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var objectObj = bodyObj.createElement("object");
objectObj.height = 23;
// -->
</script>
</html>

HTMLObjectElement.hspace

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlObjectObj.hspace

Description

The hspace property of the HTMLObjectElement is the horizontal space to the left and right of this image, applet, or object.

Example

Listing 11.234 illustrates the creation of an HTMLObjectElement using the HTMLBodyElement object and then setting its hspace property.

Listing 11.234 Creating an HTMLObjectElement and Setting Its hspace Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var objectObj = bodyObj.createElement("object");
objectObj.hspace = 1;
// -->
</script>
</html>

HTMLObjectElement.name

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlObjectObj.name

Description

The name property of the HTMLObjectElement object is the form control or object name when submitted with a form.

Example

Listing 11.235 illustrates the creation of an HTMLObjectElement using the HTMLBodyElement object and then setting its name property.

Listing 11.235 Creating an HTMLObjectElement and Setting Its name Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var objectObj = bodyObj.createElement("object");
objectObj.name = "myobject";
// -->
</script>
</html>

HTMLObjectElement.standby

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlObjectObj.standby

Description

The standby property of the HTMLObjectElement object is the message to render while loading the object.

Example

Listing 11.236 illustrates the creation of an HTMLObjectElement using the HTMLBodyelement object and then setting its standby property.

Listing 11.236 Creating an HTMLObjectElement and Setting Its standby Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var objectObj = bodyObj.createElement("object");
objectObj.standby = "Please wait while loading object.";
// -->
</script>
</html>

HTMLObjectElement.tabIndex

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlObjectObj.tabIndex

Description

The tabIndex property of the HTMLObjectElement is the index that represents the element’s position in the tabbing order.

Example

Listing 11.237 illustrates the creation of an HTMLObjectElement using the HTMLBodyElement object and then setting its tabIndex property.

Listing 11.237 Creating an HTMLObjectElement and Setting Its tabIndex Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var objectObj = bodyObj.createElement("object");
objectObj.tabIndex = 3;
// -->
</script>
</html>

HTMLObjectElement.type

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlObjectObj.type

Description

The type property of the HTMLObjectElement object is the content type for data downloaded via data attribute.

Example

Listing 11.238 illustrates the creation of an HTMLObjectElement using the HTMLBodyElement object and then setting its type property.

Listing 11.238 Creating an HTMLObjectElement and Setting Its type Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var objectObj = bodyObj.createElement("object");
objectObj.type = "applicationType";
// -->
</script>
</html>

HTMLObjectElement.useMap

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlObjectObj.useMap

Description

The useMap property of the HTMLObjectElement object indicates whether or not to use a client-side image map.

Example

Listing 11.239 illustrates the creation of an HTMLObjectElement using the HTMLBodyElement object and then setting its useMap property.

Listing 11.239 Creating an HTMLObjectElement and Setting Its useMap Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var objectObj = bodyObj.createElement("object");
objectObj.useMap = true;
// -->
</script>
</html>

HTMLObjectElement.vspace

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlObjectObj.vspace

Description

The vspace property of the HTMLObjectElement object is the vertical space above and below this image, applet, or object.

Example

Listing 11.240 illustrates the creation of an HTMLObjectElement using the HTMLBodyElement object and then setting its vspace property.

Listing 11.240 Creating an HTMLObjectElement and Setting Its vspace Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var objectObj = bodyObj.createElement("object");
objectObj.vspace = 2;
// -->
</script>
</html>

HTMLObjectElement.width

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlObjectObj.width

Description

The width property of the HTMLObjectElement object overrides the width of the object.

Example

Listing 11.241 illustrates the creation of an HTMLObjectElement using the HTMLBodyElement object and then setting its width property.

Listing 11.241 Creating an HTMLObjectElement and Setting Its width Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var objectObj = bodyObj.createElement("object");
objectObj.width = 20;
// -->
</script>
</html>

HTMLOListElement

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

Core DOM HTML object.

Description

This object represents an HTML ordered list element. The HTMLOListElement object inherits all methods and properties of the HTMLElement object. Table 11.28 contains a list of properties for this object.

Table 11.28 Properties of the HTMLElement Object

Image

Example

Listing 11.242 illustrates the creation of an HTMLOListElement using the HTMLBodyElement object.

Listing 11.242 Creating an HTMLOListElement

<html>
<script language="JavaScript" type="text/javascript">
<!--
var olObj = bodyObj.CreateElement("ol");
// -->
</script>
</html>

HTMLOListElement.compact

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlOListObj.compact

Description

The compact property of the HTMLOListElement object reduces spacing between list items.

Example

Listing 11.243 illustrates the creation of an HTMLOListElement using the HTMLBodyElement object and then setting its compact property.

Listing 11.243 Creating an HTMLOListElement and Setting Its compact Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var olObj = bodyObj.CreateElement("ol");
olObj.compact = true;
// -->
</script>
</html>

HTMLOListElement.start

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlOListObj.start

Description

The start property of the HTMLOListElement object is the starting sequence number.

Example

Listing 11.244 illustrates the creation of an HTMLOListElement using the HTMLBodyElement object and then setting its start property.

Listing 11.244 Creating an HTMLOListElement and Setting Its start Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var olObj = bodyObj.CreateElement("ol");
olObj.start = 1;
// -->
</script>
</html>

HTMLOListElement.type

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlOListObj.type

Description

The type property of the HTMLOListElement object indicates its numbering style.

Example

Listing 11.245 illustrates the creation of an HTMLOListElement using the HTMLBodyElement object and then setting its type property.

Listing 11.245 Creating an HTMLOListElement and Setting Its type Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var olObj = bodyObj.CreateElement("ol");
olObj.type = "ascending";
// -->
</script>
</html>

HTMLOptGroupElement

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

Core DOM HTML object.

Description

Group options together in logical subdivisions. This object inherits all methods and properties from HTMLElement. Table 11.29 contains a list of properties for this object.

Table 11.29 Properties of the HTMLOptGroupElement Object

Image

Example

Listing 11.246 illustrates the creation of an HTMLOptGroupElement using the HTMLSelectElement object.

Listing 11.246 Creating an HTMLOptGroupElement Object

<html>
<script language="JavaScript" type="text/javascript">
<!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc");
htmlDoc.open();
var bodyObj = htmlDoc.createElement("body");
var formObj = bodyObj.createElement("form");
var selectElement = formObj.createElement("select");
var optionGrp = selectElement.createElement("options");
// -->
</script>
</html>

HTMLOptGroupElement.disabled

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlOptGroupObj.disabled

Description

The disabled property of the HTMLOptGroupElement is used to disable the option group of elements.

Example

Listing 11.247 illustrates the creation of an HTMLOptGroupElement using the HTMLSelectElement object and then setting its disabled property.

Listing 11.247 Creating an HTMLOptGroupElement and Setting Its disabled Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc");
htmlDoc.open();
var bodyObj = htmlDoc.createElement("body");
var formObj = bodyObj.createElement("form");
var selectElement = formObj.createElement("select");
var optionGrp = selectElement.createElement("options");
optionGrp.disabled = true;
// -->
</script>
</html>

HTMLOptGroupElement.label

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlOptGroupObj.label

Description

The label property of the HTMLOptGroupElement assigns a label to this option group.

Example

Listing 11.248 illustrates the creation of an HTMLOptGroupElement using the HTMLSelectElement object and then setting its label property.

Listing 11.248 Creating an HTMLOptGroupElement and Setting Its label Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc");
htmlDoc.open();
var bodyObj = htmlDoc.createElement("body");
var formObj = bodyObj.createElement("form");
var selectElement = formObj.createElement("select");
var optionGrp = selectElement.createElement("options");
optionGrp.label = "Colors";
// -->
</script>
</html>

HTMLOptionElement

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

Core DOM HTML object.

Description

This object represents an HTML option element that resized in a select element. This object inherits all methods and properties from HTMLElement. Table 11.30 contains a list of properties for this object.

Table 11.30 Properties of the HTMLOptionElement Object

Image

Example

Listing 11.249 illustrates the creation of an HTMLOptionElement using the HTMLOptGroupElement object.

Listing 11.249 Creating an HTMLOptionElement

<html>
<script language="JavaScript" type="text/javascript">
<!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc");
htmlDoc.open();
var bodyObj = htmlDoc.createElement("body");
var formObj = bodyObj.createElement("form");
var selectElement = formObj.createElement("select");
var optionGrp = selectElement.createElement("options");
var optionElement = optionGrp.createElement("option");

// -->
</script>
</html>

HTMLOptionElement.defaultSelected

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlOptionObj.defaultSelected

Description

The defaultSelected property of the HTMLOptionElement object represents the value of the HTML selected attribute. The value of this attribute doesn’t change if the state of the corresponding form control, in an interactive user agent, changes. Changing defaultSelected, however, resets the state of the form control.

Example

Listing 11.250 illustrates the creation of an HTMLOptionElement using the HTMLOptGroupElement object and then setting its defaultSelected property.

Listing 11.250 Creating an HTMLOptionElement and Setting Its

<html>
<script language="JavaScript" type="text/javascript">
<!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc");
htmlDoc.open();
var bodyObj = htmlDoc.createElement("body");
var formObj = bodyObj.createElement("form");
var selectElement = formObj.createElement("select");
var optionGrp = selectElement.createElement("options");
var optionElement = optionGrp.createElement("option");
optionElement.defaultSelected = true;
// -->
</script>
</html>

HTMLOptionElement.disabled

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlOptionObj.disabled

Description

The disabled property of the HTMLOptionElement object is used to disable the option instance.

Example

Listing 11.251 illustrates the creation of an HTMLOptionElement using the HTMLSelectElement object and then setting its disabled property.

Listing 11.251 Creating an HTMLOptionElement and Setting Its disabled Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc");
htmlDoc.open();
var bodyObj = htmlDoc.createElement("body");
var formObj = bodyObj.createElement("form");
var selectElement = formObj.createElement("select");
var optionGrp = selectElement.createElement("options");
var optionElement = optionGrp.createElement("option");
optionElement.disabled = true;
// -->
</script>
</html>

HTMLOptionElement.form

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlOptionObj.form

Description

The form property of the HTMLOptionElement object returns the FORM element containing this control. Returns Null if this control isn’t within the context of a form.

Example

Listing 11.252 illustrates the creation of an HTMLOptionElement using the HTMLSelectElement object and then reading its form property.

Listing 11.252 Creating an HTMLOptionElement and Reading Its form Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc");
htmlDoc.open();
var bodyObj = htmlDoc.createElement("body");
var formObj = bodyObj.createElement("form");
var selectElement = formObj.createElement("select");
var optionGrp = selectElement.createElement("options");
var optionElement = optionGrp.createElement("option");
if(optionElement.form == "myForm")
    processOption(optionElement);
// -->
</script>
</html>

HTMLOptionElement.index

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlOptionObj.index

Description

The index property of the HTMLOptionElement object is the index of this option in its parent SELECT, starting from 0.

Example

Listing 11.253 illustrates the creation of an HTMLOptionElement using the HTMLSelectElement object and then reading its index property.

Listing 11.253 Creating an HTMLOptionElement and Reading Its index Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc");
htmlDoc.open();
var bodyObj = htmlDoc.createElement("body");
var formObj = bodyObj.createElement("form");
var selectElement = formObj.createElement("select");
var optionGrp = selectElement.createElement("options");
var optionElement = optionGrp.createElement("option");
if(optionElement.index == 0)
    processFirstOption(optionElement);
// -->
</script>
</html>

HTMLOptionElement.label

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlOptionObj.label

Description

The label property of the HTMLOptionElement object is the option label for use in hierarchical menus.

Example

Listing 11.254 illustrates the creation of an HTMLOptionElement using the HTMLSelectElement object and then setting its label property.

Listing 11.254 Creating an HTMLOptionElement and Setting Its label Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc");
htmlDoc.open();
var bodyObj = htmlDoc.createElement("body");
var formObj = bodyObj.createElement("form");
var selectElement = formObj.createElement("select");
var optionGrp = selectElement.createElement("options");
var optionElement = optionGrp.createElement("option");
optionElement.label = "Green";
// -->
</script>
</html>

HTMLOptionElement.selected

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlOptionObj.selected

Description

The selected property of the HTMLOptionElement object represents the current state of the corresponding form control, in an interactive user agent. Changing this attribute changes the state of the form control, but does not change the value of the HTML selected attribute of the element.

Example

Listing 11.255 illustrates the creation of an HTMLOptionElement using the HTMLSelectElement object and then setting its selected property.

Listing 11.255 Creating an HTMLOptionElement and Setting Its selected Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc");
htmlDoc.open();
var bodyObj = htmlDoc.createElement("body");
var formObj = bodyObj.createElement("form");
var selectElement = formObj.createElement("select");
var optionGrp = selectElement.createElement("options");
var optionElement = optionGrp.createElement("option");
optionElement.selected = "true";
// -->
</script>
</html>

HTMLOptionElement.text

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlOptionObj. text

Description

The text property of the HTMLOptionElement object is the text contained within the option element.

Example

Listing 11.256 illustrates the creation of an HTMLOptionElement using the HTMLSelectElement object and then setting its text property.

Listing 11.256 Creating an HTMLOptionElement and Setting Its text Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc");
htmlDoc.open();
var bodyObj = htmlDoc.createElement("body");
var formObj = bodyObj.createElement("form");

var selectElement = formObj.createElement("select");
var optionGrp = selectElement.createElement("options");
var optionElement = optionGrp.createElement("option");
var optionElement.text = "Blue";
// -->
</script>
</html>

HTMLOptionElement.value

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlOptionObj. value

Description

The value property of the HTMLOptionElement object is the current form control value.

Example

Listing 11.257 illustrates the creation of an HTMLOptionElement using the HTMLSelectElement object and then setting its value property.

Listing 11.257 Creating an HTMLOptionElement and Setting Its value Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc");
htmlDoc.open();
var bodyObj = htmlDoc.createElement("body");
var formObj = bodyObj.createElement("form");
var selectElement = formObj.createElement("select");
var optionGrp = selectElement.createElement("options");
var optionElement = optionGrp.createElement("option");
optionElement.value = "g";
// -->
</script>
</html>

HTMLParagraphElement

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

Core DOM HTML object.

Description

This object represents an HTML paragraph element. The HTMLParagraph element inherits all methods and properties of the HTMLElement object. The property for this object is as follows:

Image

Example

Listing 11.258 illustrates the creation of an HTMLParagraphElement using the HTMLBodyElement object and then setting its align property.

Listing 11.258 Creating an HTMLParagraph and Setting Its align Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var paragraphObj = bodyObj.CreateElement("p");
paragraphObj.align = "top";
// -->
</script>
</html>

HTMLParagraphElement.align

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlParagraphObj.align

Description

The align property of the HTMLParagraphElement object is the horizontal text alignment.

Example

Listing 11.259 illustrates the creation of an HTMLParagraphElement using the HTMLBodyElement object and then setting its align property.

Listing 11.259 Creating an HTMLParagraphElement and Setting Its align Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var paragraphObj = bodyObj.CreateElement("p");
paragraphObj.align = "bottom";

// -->
</script>
</html>

HTMLParamElement

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

Core DOM HTML object.

Description

This object represents an HTML parameter element. The HTMLParamElement object inherits all methods and properties of the HTMLElement object. Table 11.31 contains a list of properties for this object.

Table 11.31 Properties of the HTMLParamElement Object

Image

Example

Listing 11.260 illustrates the creation of an HTMLParamElement using the HTMLMetaElement object.

Listing 11.260 Creating an HTMLParamElement

<html>
<script language="JavaScript" type="text/javascript">
<!--
var metaObj = bodyObj.createElement("meta");
var paramObj = metaObj.createElement("param");

// -->
</script>
</html>

HTMLParamElement.name

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlParamObj.name

Description

The name property of the HTMLParamElement object is the name of a runtime parameter.

Example

Listing 11.261 illustrates the creation of an HTMLParamElement using the HTMLMetaElement object and then setting its name.

Listing 11.261 Creating an HTMLParamElement and Setting Its name

<html>
<script language="JavaScript" type="text/javascript">
<!--
var metaObj = bodyObj.createElement("meta");
var paramObj = metaObj.createElement("param");
paramObj.name = "keywords"

// -->
</script>
</html>

HTMLParamElement.type

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlParamObj.type

Description

The type property of the HTMLParamElement is the content type for the value attribute when valuetype has the value "ref".

Example

Listing 11.262 illustrates the creation of an HTMLParamElement using the HTMLMetaElement object and then setting its name, value, and type properties.

Listing 11.262 Creating an HTMLParamElement and Setting Its name, value, and type Properties

<html>
<script language="JavaScript" type="text/javascript">
<!--
var metaObj = bodyObj.createElement("meta");
var paramObj = metaObj.createElement("param");
paramObj.name = "keywords"
paramObj.value = "horses,cows,sheep";
paramObj.type = "animals";

// -->
</script>
</html>

HTMLParamElement.value

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlParamObj.value

Description

The value property of the HTMLParamElement object is the value of a runtime parameter.

Example

Listing 11.263 illustrates the creation of an HTMLParamElement using the HTMLMetaElement object and then setting its value property.

Listing 11.263 Creating an HTMLParamElement and Setting Its value Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var metaObj = bodyObj.createElement("meta");
var paramObj = metaObj.createElement("param");

paramObj.value = "horses,cows,sheep";
// -->
</script>
</html>

HTMLParamElement.valueType

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlParamObj.valueType

Description

The valueType property of the HTMLParamElement object is information about the meaning of the value attribute value.

Example

Listing 11.264 illustrates the creation of an HTMLParamElement using the HTMLMetaElement object element and then setting its valueType and name properties.

Listing 11.264 Creating an HTMLParamElement and Setting Its valueType and name Properties

<html>
<script language="JavaScript" type="text/javascript">
<!--
var metaObj = bodyObj.createElement("meta");
var paramObj = metaObj.createElement("param");
paramObj.name = "keywords"
paramObj.valueType = "ref";
// -->
</script>
</html>

HTMLPreElement

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

Core DOM HTML object.

Description

This object represents an HTML pre-formatted text element. The HTMLPreElement inherits all properties and methods of HTMLElement. The property for this object is as follows:

Image

Example

Listing 11.265 illustrates the creation of an HTMLPreElement using the HTMLBodyElement object.

Listing 11.265 Creating an HTMLPreElement

<html>
<script language="JavaScript" type="text/javascript">
<!--
var preObj = bodyObj.createElement("pre");

// -->
</script>
</html>

HTMLPreElement.width

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlPreObj.width

Description

The width property of the HTMLPreElement object is the fixed width for content.

Example

Listing 11.266 illustrates the creation of an HTMLPreElement using the HTMLBodyElement object and then setting its width property.

Listing 11.266 Creating an HTMLPreElement and Setting Its width Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var preObj = bodyObj.CreateElement("pre");
preObj.width = 25;
// -->
</script>
</html>

HTMLQuoteElement

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

Core DOM HTML object.

Description

This object represents both HTML Q and BLOCKQUOTE elements. The HTMLQuoteElement inherits all properties and methods from HTMLElement. The property for this object is as follows:

Image

Example

Listing 11.267 illustrates the creation of an HTMLQuoteElement using the HTMLBodyElement object.

Listing 11.267 Creating an HTMLQuoteElement

<html>
<script language="JavaScript" type="text/javascript">
<!--
var quoteObj = bodyObj.CreateElment("quote");

// -->
</script>
</html>

HTMLQuoteElement.cite

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlQuoteObj.cite

Description

The cite property of the HTMLQuoteElement object is a URI designating a source document or message.

Example

Listing 11.268 illustrates the creation of an HTMLQuoteElement using the HTMLBodyElement object and then setting its cite property.

Listing 11.268 Creating an HTMLQuoteElement and Setting Its cite Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var quoteObj = bodyObj.CreateElement("quote");
quoteObj.cite = "http://foo.bar/reference.html";
// -->
</script>
</html>

HTMLScriptElement

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

Core DOM HTML object.

Description

This object represents an HTML script element. HTMLScriptElement inherits all properties and methods from the HTMLElement object. Table 11.32 contains a list of properties for this object.

Table 11.32 Properties of the HTMLScriptElement Object

Image

Example

Listing 11.269 illustrates the creation of an HTMLScriptElement using the HTMLBodyElement object and then setting its text property.

Listing 11.269 Creating an HTMLScriptElement and Setting Its text Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var scriptObj = bodyObj.createElement("script");
scriptObj.text = "some script text";

// -->
</script>
</html>

HTMLScriptElement.charset

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlScriptObj.charset

Description

The charset property of the HTMLScriptElement object is the character encoding of the linked resource.

Example

Listing 11.270 illustrates the creation of an HTMLScriptElement using the HTMLBodyElement object and then setting its charset property.

Listing 11.270 Creating an HTMLScriptElement and Setting charset Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var scriptObj = bodyObj.createElement("script");
scriptObj.charset = "us/english";

// -->
</script>
</html>

HTMLScriptElement.defer

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlScriptObj.defer

Description

The defer property of the HTMLScriptElement object indicates that the user agent can defer processing of the script.

Example

Listing 11.271 illustrates the creation of an HTMLScriptElement using the HTMLBodyElement object and then setting its defer property.

Listing 11.271 Creating an HTMLScriptElement and Setting Its defer Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var scriptObj = bodyObj.createElement("script");
scriptObj.defer = true;
// -->
</script>
</html>

HTMLScriptElement.event

JavaScript 1.5+, JScript 5.0+

Nav6+, IE5+

 

Syntax

htmlScript.event

Description

The event property of the HTMLScriptElement object is reserved for future use.

HTMLScriptElement.htmlFor

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlScriptObj.htmlFor

Description

The htmlFor property of the HTMLScriptElement object is reserved for future use.

HTMLScriptElement.src

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlScriptObj.src

Description

The src property of the HTMLScriptElement object is a URI designating an external script.

Example

Listing 11.272 illustrates the creation of an HTMLScriptElement using the HTMLBodyElement object.

Listing 11.272 Creating an HTMLScriptElement

<html>
<script language="JavaScript" type="text/javascript">
<!--
var scriptObj = bodyObj.createElement("script");


// -->
</script>
</html>

HTMLScriptElement.text

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlScriptObj.text

Description

The text property of the HTMLScriptElement object is the script content of the element.

Example

Listing 11.273 illustrates the creation of an HTMLScriptElement using the HTMLBodyElement object element and then setting its text property.

Listing 11.273 Creating an HTMLScriptElement and Setting Its text Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var scriptObj = bodyObj.createElement("script");
scriptObj.text = "some script text";

// -->
</script>
</html>

HTMLScriptElement.type

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlScriptObj.type

Description

The type property of the HTMLScriptElement is the content type of the script language.

Example

Listing 11.274 illustrates the creation of an HTMLScriptElement using the HTMLBodyElement object and then setting its type property.

Listing 11.274 Creating an HTMLScriptElement and Setting Its type Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var scriptObj = bodyObj.createElement("script");
scriptObj.type = "text/html";

// -->
</script>
</html>

HTMLSelectElement

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

Core DOM HTML object.

Description

The select element allows the selection of an option. The contained options can be directly accessed through the select element as a collection. This object inherits all methods and properties from HTMLElement. Table 11.33 contains a list of properties and methods for this object.

Table 11.33 Contents of the HTMLSelectElement Object

Image

Example

Listing 11.275 illustrates the creation of an HTMLSelectElement using the HTMLFormElement object.

Listing 11.275 Creating an HTMLSelectElement Object

<html>
<script language="JavaScript" type="text/javascript">
<!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc");
htmlDoc.open();
var bodyObj = htmlDoc.createElement("body");
var formObj = bodyObj.createElement("form");
var selectElement = formObj.createElement("select");
// -->
</script>
</html>

HTMLSelectElement.add()

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlSelectObj.add(element, before)

Description

The add() method of the HTMLSelectElement object adds a new element to the collection of OPTION elements for this SELECT. This method is equivalent to the AppendChild() method of the Node object if the before parameter is Null. It is equivalent to the InsertBefore() method on the parent of before in all other cases.

Example

Listing 11.276 illustrates the creation of a HTMLSelectElement and invoking its add() method.

Listing 11.276 Creating an HTMLSelectElement and Invoking add()

<html>
<script language="JavaScript" type="text/javascript">
<!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc");
htmlDoc.open();
var bodyObj = htmlDoc.createElement("body");
var formObj = bodyObj.createElement("form");
var selectObj = formObj.createElement("select");
var optionObj = htmlDoc.createElement("option");
selectObj.add(optionObj, null);

// -->
<script>
</html>

HTMLSelectElement.blur()

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlSelectObj.blur()

Description

The blur() method of the HTMLSelectElement object removes keyboard focus from this element.

Example

Listing 11.277 illustrates the creation of a HTMLSelectElement and invoking its blur() method.

Listing 11.277 Creating an HTMLSelectElement and Invoking blur()

<html>
<script language="JavaScript" type="text/javascript">
<!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc");
htmlDoc.open();
var bodyObj = htmlDoc.createElement("body");
var formObj = bodyObj.createElement("form");
var selectObj = formObj.createElement("select");
selectObj.blur();
// -->
</script>
</html>

HTMLSelectElement.disabled

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlSelectObj.disabled

Description

The disabled property of the HTMLSelectElement object is used to disable the select element instance.

Example

Listing 11.278 illustrates the creation of an HTMLSelectElement using an HTMLFormElement object and setting its disabled property.

Listing 11.278 Creating an HTMLSelectElement and Setting disabled

<html>
<script language="JavaScript" type="text/javascript">
<!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc");
htmlDoc.open();
var bodyObj = htmlDoc.createElement("body");
var formObj = bodyObj.createElement("form");
var selectObj = formObj.createElement("select");
selectObj.disabled = true;
}
// -->
</script>
</html>

HTMLSelectElement.focus()

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlSelectObj.focus()

Description

The focus() method of the HTMLSelectElement object gives keyboard focus to this element.

Example

Listing 11.279 illustrates the creation of a HTMLSelectElement and invoking its focus() method.

Listing 11.279 Creating an HTMLSelectElement and Invoking focus()

<html>
<script language="JavaScript" type="text/javascript">
<!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc");
htmlDoc.open();
var bodyObj = htmlDoc.createElement("body");
var formObj = bodyObj.createElement("form");
var selectObj = formObj.createElement("select");
selectObj.focus()
// -->
</script>
</html>

HTMLSelectElement.form

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlSelectObj.form

Description

The form property of the HTMLSelectElement object returns the FORM element containing this control. Returns Null if this control isn’t within the context of a form.

Example

Listing 11.280 illustrates the reading an HTMLSelectElement’s form property.

Listing 11.280 Reading the form Property of HTMLSelectElement

<html>
<script language="JavaScript" type="text/javascript">
<!--
function submitFormFromSelect(selectObj) {
  var formObj = selectObj.form;
  formObj.submit();
}
// -->
</script>
</html>

HTMLSelectElement.length

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlSelectObj.length

Description

The length property of the HTMLSelectElement object is the number of options in this SELECT.

Example

Listing 11.281 illustrates the creation of a HTMLSelectObject and reading its length property.

Listing 11.281 Reading the length Property of HTMLSelectObject

<html>
<script language="JavaScript" type="text/javascript">
<!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc");
htmlDoc.open();
var bodyObj = htmlDoc.createElement("body");
var formObj = bodyObj.createElement("form");
var selectObj = formObj.createElement("select");
var optionList = selectObj.options;
var i = 0;
while( i < selectObj.length) {
  processOption(optionList.index(i));
  i++;
}
// -->
</script>
</html>

HTMLSelectElement.multiple

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlSelectObj.multiple

Description

The multiple property of the HTMLSelectElement object indicates whether or not multiple OPTION elements can be selected in this SELECT.

Example

Listing 11.282 illustrates the creation of a HTMLSelectElement and setting its multiple property.

Listing 11.282 Setting the multiple Property of HTMLSelectElement

<html>
<script language="JavaScript" type="text/javascript">
<!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc");
htmlDoc.open();
var bodyObj = htmlDoc.createElement("body");
var formObj = bodyObj.createElement("form");
var selectObj = formObj.createElement("select");
selectObj.multiple = true;
}
// -->
</script>
</html>

HTMLSelectElement.name

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlSelectObj.name

Description

The name property of the HTMLSelectElement object is the form control or object name when submitted with a form.

Example

Listing 11.283 illustrates the creation of a HTMLSelectElement and setting its name property.

Listing 11.283 Setting the name Property of HTMLSelectElement

<html>
<script language="JavaScript" type="text/javascript">
<!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc");
htmlDoc.open();
var bodyObj = htmlDoc.createElement("body");
var formObj = bodyObj.createElement("form");
var selectObj = formObj.createElement("select");
selectObj.name = "Color Selection";
// -->
</script>
</html>

HTMLSelectElement.options

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlSelectObj.options

Description

The options property of the HTMLSelectElement object is the collection of OPTION elements contained by this element.

Example

Listing 11.284 illustrates the creation of a HTMLSelectElement and iterating through its options property.

Listing 11.284 Iterating Through an HTMLSelectElement ’s options Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc");
htmlDoc.open();
var bodyObj = htmlDoc.createElement("body");
var formObj = bodyObj.createElement("form");
var selectObj = formObj.createElement("select");
var optionList = selectObj.options;
var i = 0;
while( i < selectObj.length) {
  processOption(optionList.index(i));
  i++;
}
// -->
</script>
</html>

HTMLSelectElement.remove()

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlSelectObj.remove(index)

Description

The remove() method of the HTMLSelectElement object removes an element from the collection of OPTION elements for this SELECT. Does nothing if no element has the given index.

Example

Listing 11.285 illustrates the creation of a HTMLSelectElement and invoking its remove() method.

Listing 11.285 Invoking the remove() Method of HTMLSelectElement

<html>
<script language="JavaScript" type="text/javascript">
<!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc");
htmlDoc.open();
var bodyObj = htmlDoc.createElement("body");
var formObj = bodyObj.createElement("form");
var selectObj = formObj.createElement("select");
selectObj.remove(selectObj.selectedIndex);
// -->
</script>
</html>

HTMLSelectElement.selectedIndex

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlSelectObj.selectedIndex

Description

The selectedIndex property of the HTMLSelectElement object is the ordinal index of the selected option, starting from 0. The value -1 is returned if no element is selected. If multiple options are selected, the index of the first selected option is returned.

Example

Listing 11.286 illustrates the creation of an HTMLSelectElement using the HTMLFormElement object and then setting its selectedIndex property.

Listing 11.286 Creating an HTMLSelectElement and Setting Its selectedIndex Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc");
htmlDoc.open();
var bodyObj = htmlDoc.createElement("body");
var formObj = bodyObj.createElement("form");
var selectObj = formObj.createElement("select");
var optionObj = htmlDoc.createElement("option");
selectObj.Add(optionObj);
selectObj.selectedIndex = 0;
// -->
</script>
</html>

HTMLSelectElement.size

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlSelectObj.size

Description

The size property of the HTMLSelectElement object is the number of visible rows.

Example

Listing 11.287 illustrates the creation of an HTMLSelectElement and setting its size property.

Listing 11.287 Setting the size Property of HTMLSelectElement

<html>
<script language="JavaScript" type="text/javascript">
<!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc");
htmlDoc.open();
var bodyObj = htmlDoc.createElement("body");
var formObj = bodyObj.createElement("form");
var selectObj = formObj.createElement("select");
selectObj.size = 20;
}
// -->
</script>
</html>

HTMLSelectElement.tabIndex

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlSelectObj.tabIndex

Description

The tabIndex property of the HTMLSelectElement is the index that represents the element’s position in the tabbing order.

Example

Listing 11.288 illustrates the creation of an HTMLSelectElement and setting its tabIndex property.

Listing 11.288 Setting the tabIndex Property of HTMLSelectElement

<html>
<script language="JavaScript" type="text/javascript">
<!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc");
htmlDoc.open();
var bodyObj = htmlDoc.createElement("body");
var formObj = bodyObj.createElement("form");
var selectObj = formObj.createElement("select");
selectObj.tabIndex = 4;
// -->
</script>
</html>

HTMLSelectElement.type

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlSelectObj.type

Description

The type property of the HTMLSelectElement object is the type of this form control. This is the string "select-multiple" when the multiple attribute is True and the string "select-one" when False.

Example

Listing 11.289 illustrates the creation of an HTMLSelectElement using the HTMLFormElement object and then setting its type property.

Listing 11.289 Creating an HTMLSelectElement and Setting Its type Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc");
htmlDoc.open();
var bodyObj = htmlDoc.createElement("body");
var formObj = bodyObj=createElement("form");
var selectObj = formObj=createElement("select");
selectObj.type = "select-multiple";
// -->
</script>
</html>

HTMLSelectElement.value

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlSelectObj.value

Description

The value property of the HTMLSelectElement object is the current form control value.

Example

Listing 11.290 illustrates the creation of an HTMLSelectElement using the HTMLFormElement object and then setting its value property.

Listing 11.290 Creating an HTMLSelectElement and Setting Its value Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc");
htmlDoc.open();
var bodyObj = htmlDoc.createElement("body");
var formObj = bodyObj.createElement("form");
var selectObj = formObj.createElement("select");
selectObj.value = "selection text";
// -->
</script>
</html>

HTMLStyleElement

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

Core DOM HTML object.

Description

Represents style information contained in a style sheet. HTMLStyleElement inherits all methods and properties from HTMLElement. Table 11.34 contains a list of properties for this object.

Table 11.34 Properties of the HTMLStyleElement Object

Image

Example

Listing 11.291 illustrates the creation of an HTMLStyleElement using the HTMLDocument.

Listing 11.291 Creating an HTMLStyleElement

<html>
<script language="JavaScript" type="text/javascript">
<!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc");
htmlDoc.open();
var styleObj = htmlDoc.createElement("style");

// -->
</script>
</html>

HTMLStyleElement.disabled

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

styleInfoObj.disabled

Description

The disabled property of the HTMLStyleElement enables/disables the style sheet.

Example

Listing 11.292 illustrates the creation of an HTMLStyleObject using the HTMLDocument object element and then disabling it.

Listing 11.292 Creating an HTMLStyleElement and Setting disabled Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc");
htmlDoc.open();
var styleObj = htmlDoc.createElement("style");
styleObj.disabled = true;
// -->
</script>
</html>

HTMLStyleElement.media

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

styleInfoObj.media

Description

The media property of the HTMLStyleElement object is designed for use with one or more target media.

Example

Listing 11.293 illustrates the creation of an HTMLStyleObject using the HTMLDocument object element and then setting its media property.

Listing 11.293 Creating an HTMLStyleObject and Setting Its media Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc");
htmlDoc.open();
var styleObj = htmlDoc.createElement("style");
styleObj.media = "jpg";
// -->
</script>
</html>

HTMLStyleElement.type

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

styleInfoObj.type

Description

The type property of the HTMLStyleElement object is the content type of the style sheet language.

Example

Listing 11.294 illustrates the creation of an HTMLStyleObject using the HTMLDocument object element and then setting its type property.

Listing 11.294 Creating an HTMLStyleObject and Setting Its type Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc");
htmlDoc.open();
var styleObj = htmlDoc.createElement("style");
styleObj.type = "text/html";
// -->
</script>
</html>

HTMLTableCaptionElement

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

Core DOM HTML object.

Description

This object represents an HTML table caption element. HTMLTableCaptionElement inherits all properties and methods from HTMLElement. The property for this object is as follows:

Item

Description

align

Aligns caption with respect to the table it resides in

Example

Listing 11.295 illustrates the creation of an HTMLTableCaptionElement using the HTMLTableElement object.

Listing 11.295 Creating an HTMLTableCaptionElement

<html>
<script language="JavaScript" type="text/javascript">
<!--
var tableObj = bodyObj.createElement("table");
var captionObj = tableObj.createCaption();

// -->
</script>
</html>

HTMLTableCaptionElement.align

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableCaptionObj.align

Description

The align property of the HTMLTableCaptionElement is the caption alignment with respect to the table.

Example

Listing 11.296 illustrates the creation of an HTMLTableCaptionElement using the HTMLTableElement object and then setting its align property.

Listing 11.296 Creating an HTMLTableCaptionElement and Setting align Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var tableObj = bodyObj.createElement("table");
var captionObj = tableObj.createCaption();
captionObj.align = "top";
// -->
</script>
</html>

HTMLTableCellElement

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

Core DOM HTML object.

Description

This object is used to represent the TH and TD elements. The HTMLTableCellElement object inherits all methods and properties from the HTMLElement object. Table 11.35 contains a list of properties for this object.

Table 11.35 Properties of the HTMLTableCellElement Object

Image

Example

Listing 11.297 illustrates the creation of an HTMLTableCellElement using the insertRow() method of the HTMLTableRowElement object.

Listing 11.297 Creating an HTMLTableCellElement

<html>
<script language="JavaScript" type="text/javascript">
<!--
var rowObj = tableObj.insertRow(1);
var cellObj = rowObj.insertCell(2);
// -->
</script>
</html>

HTMLTableCellElement.abbr

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableCellObj.abbr

Description

The abbr property of the HTMLTableCellElement object is an abbreviation for header cells.

Example

Listing 11.298 illustrates the creation of an HTMLTableCellElement using the HTMLTableRowElement object and then setting its abbr property.

Listing 11.298 Creating an HTMLTableCellElement and Setting Its abbr Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var rowObj = tableObj.insertRow(1);
var cellObj = rowObj.insertCell(1);
cellObj.abbr = "Admin";
// -->
</html>

HTMLTableCellElement.align

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableCellObj.align

Description

The align property of the HTMLTableCellElement object is the horizontal alignment of data in cell.

Example

Listing 11.299 illustrates the creation of an HTMLTableCellElement using the HTMLTableRow object and then setting its align property.

Listing 11.299 Creating an HTMLTableCellElement and Setting Its align Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
cellObj.align = "center";
// -->
</script>
</html>

HTMLTableCellElement.axis

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableCellObj.axis

Description

The axis property of the HTMLTableCellElement object names group of related headers.

Example

Listing 11.300 illustrates the creation of an HTMLTableCellElement and then setting its axis property.

Listing 11.300 Creating an HTMLTableCellElement and Setting Its axis Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
cellObj.axis = "Colors";
// -->
</script>
</html>

HTMLTableCellElement.bgColor

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableCellObj.bgColor

Description

The bgColor property of the HTMLTableCellElement object is the cell background color.

Example

Listing 11.301 illustrates the creation of an HTMLTableCellElement and then setting its bgColor property.

Listing 11.301 Creating an HTMLTableCellElement and Setting Its bgColor Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
cellObj.bgColor = "blue";
// -->
</script>
</html>

HTMLTableCellElement.cellIndex

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableCellObj.cellIndex

Description

The cellIndex property of the HTMLTableCellElement object is the index of this cell in the row, starting from 0. This index is in document tree order and not display order.

Example

Listing 11.302 illustrates the creation of an HTMLTableCellElement and then reading its cellIndex property.

Listing 11.302 Creating an HTMLTableCellElement and Reading Its cellIndex Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
if(cellObj.cellIndex == 1)
    handleFirstCell(cellObj);
// -->
</script>
</html>

HTMLTableCellElement.ch

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableCellObj.ch

Description

The ch property of the HTMLTableCellElement object is the alignment character for cells in a column.

Example

Listing 11.303 illustrates the creation of an HTMLTableCellElement and then setting its ch property.

Listing 11.303 Creating an HTMLTableCellElement and Setting Its ch Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
cellObj.ch = ".";
// -->
</html>

HTMLTableCellElement.chOff

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableCellObj.chOff

Description

The chOff property of the HTMLTableCellElement object is the offset of alignment character.

Example

Listing 11.304 illustrates the creation of an HTMLTableCellElement and then setting its chOff property.

Listing 11.304 Creating an HTMLTableCellElement and Setting Its chOff Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
cellObj.chOff = "1";
// -->
</script>
</html>

HTMLTableCellElement.colSpan

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableCellObj.colSpan

Description

The colSpan property of the HTMLTableCellElement object is the number of columns spanned by cell.

Example

Listing 11.305 illustrates the creation of an HTMLTableCellElement and then setting its colSpan property.

Listing 11.305 Creating an HTMLTableCellElement and Setting colSpan Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
cellObj.colSpan = 3;
// -->
</script>
</html>

HTMLTableCellElement.headers

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableCellObj.headers

Description

The headers property of the HTMLTableCellElement object is a list of id attribute values for header cells.

Example

Listing 11.306 illustrates the creation of an HTMLTableCellElement and then setting its headers property.

Listing 11.306 Creating an HTMLTableCellElement and Setting Its header Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
cellObj.headers = "foo,bar";
// -->
</script>
</html>

HTMLTableCellElement.height

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableCellObj.height

Description

The height property of the HTMLTableCellElement object is the cell height.

Example

Listing 11.307 illustrates the creation of an HTMLTableCellElement and then setting its height property.

Listing 11.307 Creating an HTMLTableCellElement and Setting Its height Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
cellObj.height = 25;
// -->
</script>
</html>

HTMLTableCellElement.noWrap

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableCellObj.noWrap

Description

The noWrap property of the HTMLTableCellElement object Suppresses word wrapping when true.

Example

Listing 11.308 illustrates the creation of an HTMLTableCellElement and then setting its noWrap property.

Listing 11.308 Creating an HTMLTableCellElement and Setting Its noWrap Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
cellObj.noWrap = true;
// -->
</script>
</html>

HTMLTableCellElement.rowSpan

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableCellObj.rowSpan

Description

The rowSpan property of the HTMLTableCellElement object is the number of rows spanned by cell.

Example

Listing 11.309 illustrates the creation of an HTMLTableCellElement and then setting its rowSpan property.

Listing 11.309 Creating an HTMLTableCellElement and Setting Its rowSpan Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
cellObj.rowSpan = 3;
// -->
</script>
</html>

HTMLTableCellElement.scope

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableCellObj.scope

Description

The scope property of the HTMLTableCellElement object is the scope covered by header cells.

Example

Listing 11.310 illustrates the creation of an HTMLTableCellElement and then setting its scope property.

Listing 11.310 Creating an HTMLTableCellElement and Setting Its scope Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
cellObj.scope = "row";
// -->
</script>
</html>

HTMLTableCellElement.vAlign

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableCellObj.vAlign

Description

the vAlign property of the HTMLTableCellElement object is the vertical alignment of data in cell.

Example

Listing 11.311 illustrates the creation of an HTMLTableCellElement and then setting its vAlign property.

Listing 11.311 Creating an HTMLTableCellElement and Setting Its vAlign Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
cellObj.vAlign = "top";
// -->
</script>
</html>

HTMLTableCellElement.width

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableCellObj.width

Description

The width property of the HTMLTableCellElement object is the cell width.

Example

Listing 11.312 illustrates the creation of an HTMLTableCellElement and then setting its width property.

Listing 11.312 Creating an HTMLTableCellElement and Setting Its width Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
cellObj.width = 35;
// -->
</script>
</html>

HTMLTableColElement

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

Core DOM HTML object.

Description

This object represents both the HTML COL and COLGROUP elements. HTMLTableColElement object inherits all properties and methods from HTMLElement. Table 11.36 contains a list of properties for this object.

Table 11.36 Properties of the HTMLTableColElement Object

Image

Example

Listing 11.313 illustrates the creation of an HTMLTableColElement using the HTMLTableRowElement object.

Listing 11.313 Creating an HTMLTableColElement

<html>
<script language="JavaScript" type="text/javascript">
<!--
var tableObj = bodyObj.createElement("table");
var rowObj = tableObj.insertRow(2);
var columnObj = rowObj.createElement("td");

// -->
</script>
</html>

HTMLTableColElement.align

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableColObj.align

Description

The The align property of the HTMLTableColElement object is the horizontal alignment of cell data in column.

Example

Listing 11.314 illustrates the creation of an HTMLTableColElement using the HTMLTableRowElement object and then setting its align property.

Listing 11.314 Creating an HTMLTableColElement and Setting Its align Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var tableObj = bodyObj.createElement("table");
var rowObj = tableObj.insertRow(2);
var columnObj = rowObj.createElement("td");
columnObj.align = "center";
// -->
</script>
</html>

HTMLTableColElement.ch

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableColObject.ch

Description

The ch property of the HTMLTableColElement object is the alignment character for cells in a column.

Example

Listing 11.315 illustrates the creation of an HTMLTableColElement using the HTMLTableRowElement object and then setting its ch property.

Listing 11.315 Creating an HTMLTableColElement and Setting Its ch Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var tableObj = bodyObj.createElement("table");
var rowObj = tableObj.insertRow(2);
var columnObj = rowObj.createElement("td");
columnObj.align = "char";
columnObj.ch = ".";
// -->
</script>
</html>

HTMLTableColElement.chOff

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableColObject.chOff

Description

The chOff property of the HTMLTableColElement object is the offset of alignment character.

Example

Listing 11.316 illustrates the creation of an HTMLTableColElement using the HTMLTableRowElement object element and then setting its chOff property.

Listing 11.316 Setting the chOff Property of HTMLTableColElement

<html>
<script language="JavaScript" type="text/javascript">
<!--
var tableObj = bodyObj.createElement("table");
var rowObj = tableObj.insertRow(2);
var columnObj = rowObj.createElement("col");
columnObj.align = "char";
columnObj.chOff = 3;
// -->
</script>
</html>

HTMLTableColElement.span

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableColObj.span

Description

The span property of the HTMLTableColElement object indicates the number of columns in a group or affected by a grouping.

Example

Listing 11.317 illustrates the creation of an HTMLTableColElement using the HTMLTableRowElement object and then setting its span property.

Listing 11.317 Creating an HTMLTableColElement and Setting Its span Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var tableObj = bodyObj.createElement("table");
var rowObj = tableObj.insertRow(2);
var columnObj = rowObj.createElement("col");
columnObj.span = 3;
// -->
</script>
</html>

HTMLTableColElement.vAlign

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableColObj.vAlign

Description

The vAlign property of the HTMLTableColElement object is the vertical alignment of cell data in column.

Example

Listing 11.318 illustrates the creation of an HTMLTableColElement using the HTMLTableRowElement object and then setting its vAlign property.

Listing 11.318 Setting the vAlign Property of the HTMLTableColElement

<html>
<script language="JavaScript" type="text/javascript">
<!--
var tableObj = bodyObj.createElement("table");
var rowObj = tableObj.insertRow(2);
var columnObj = rowObj.createElement("td");
columnObj.vAlign = "top";
// -->
</script>
</html>

HTMLTableColElement.width

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableColObj.width

Description

The width property of the HTMLTableColElement object is the default column width.

Example

Listing 11.319 illustrates the creation of an HTMLTableColElement using the HTMLTableRowElement object element and then setting its width property.

Listing 11.319 Setting the width Property of the HTMLTableColElement

<html>
<script language="JavaScript" type="text/javascript">
<!--
var tableObj = bodyObj.createElement("table");
var rowObj = tableObj.insertRow(2);
var columnObj = rowObj.createElement("td");
columnObj.width = 44;
// -->
<script>
</html>

HTMLTableElement

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

Core DOM HTML object.

Description

This object represents an HTML table element. HTMLTableElement inherits all properties and methods from the HTMLElement object. Table 11.37 contains a list of properties and methods for this object.

Table 11.37 Contents of the HTMLTableElement Object

Image

Example

Listing 11.320 illustrates the creation of an HTMLTableElement using the HTMLBodyElement object and then setting its caption property.

Listing 11.320 Creating an HTMLTableElement and Setting Its caption Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var tableObj = bodyObj.createElement("table");
tableObj.caption = "My Table";
// -->
</script>
</html>

HTMLTableElement.align

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableObj.align

Description

The align property of the HTMLTableElement object specifies the table’s position with respect to the rest of the document.

Example

Listing 11.321 illustrates the creation of an HTMLTableElement using the HTMLBodyElement object and then setting its align property.

Listing 11.321 Setting the align Property of the HTMLTableElement

<html>
<script language="JavaScript" type="text/javascript">
<!--
var tableObj = bodyObj.createElement("table");
tableObj.align = "top";
// -->
</script>
</html>

HTMLTableElement.bgColor

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableObj.bgColor

Description

The bgColor property of the HTMLTableElement object is the cell background color.

Example

Listing 11.322 illustrates the creation of an HTMLTableElement using the HTMLBodyElement object and then setting its bgColor property.

Listing 11.322 Creating an HTMLTableElement and Setting Its bgColor Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var tableObj = bodyObj.createElement("table");
tableObj.bgColor = "#000000";
// -->
</script>
</html>

HTMLTableElement.border

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableObj.border

Description

The border property of the HTMLTableElement object is the width of the border around the table.

Example

Listing 11.323 illustrates the creation of an HTMLTableElement using the HTMLBodyElement object and then setting its border property.

Listing 11.323 Setting the border Property of HTMLTableElement

<html>
<script language="JavaScript" type="text/javascript">
<!--
var tableObj = bodyObj.createElement("table");
tableObj.border = 1;
// -->
</script>
</html>

HTMLTableElement.caption

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableObj.caption

Description

The caption property of the HTMLTableElement object returns the table’s CAPTION, or void if none exists.

Example

Listing 11.324 illustrates the creation of an HTMLTableElement using the HTMLBodyElement object and then setting its caption property.

Listing 11.324 Creating an HTMLTableElement and Setting Its caption Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var tableObj = bodyObj.createElement("table");
tableObj.caption = "My Table";
// -->
</script>
</html>

HTMLTableElement.cellPadding

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableObj.cellPadding

Description

The cellPadding property of the HTMLTableElement object specifies the horizontal and vertical space between cell content and cell borders.

Example

Listing 11.325 illustrates the creation of an HTMLTableElement using the HTMLBodyElement object and then setting its cellPadding property.

Listing 11.325 Creating an HTMLTableElement and Setting Its cellPadding Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var tableObj = bodyObj.createElement("table");
tableObj.cellPadding = 0;
// -->
</script>
</html>

HTMLTableElement.cellSpacing

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableObj.cellSpacing

Description

The cellSpacing property of the HTMLTableElement object specifies the horizontal and vertical separation between cells.

Example

Listing 11.326 illustrates the creation of an HTMLTableElement using the HTMLBodyElement object and then setting its cellSpacing property.

Listing 11.326 Creating an HTMLTableElement and Setting Its cellSpacing Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var tableObj = bodyObj.createElement("table");
tableObj.cellSpacing = 2;
// -->
</script>
</html>

HTMLTableElement.createCaption()

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableObj.createCaption()

Description

The createCaption() method of the HTMLTableElement object creates a new table caption object or return an existing one.

Example

Listing 11.327 illustrates the creation of an HTMLTableElement using the HTMLBodyElement object and then the invocation of its creatCaption() method.

Listing 11.327 Creating an HTMLTableElement and Setting Its createCaption() Method

<html>
<script language="JavaScript" type="text/javascript">
<!--
var tableObj = bodyObj.createElement("table");
var captionObj = tableObj.createCaption();
// -->
</script>
</html>

HTMLTableElement.createTFoot()

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableObj.createTFoot()

Description

The createTFoot() method of the HTMLTableElement object creates a table footer row or return an existing one.

Example

Listing 11.328 illustrates the creation of an HTMLTableElement using the HTMLBodyElement object element and then the invocation of its createTFoot() method.

Listing 11.328 Creating an HTMLTableElement and Invoking createTFoot()

<html>
<script language="JavaScript" type="text/javascript">
<!--
var tableObj = bodyObj.createElement("table");
var tFootObj = tableObj.createTFoot();
// -->
</script>
</html>

HTMLTableElement.createTHead()

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableObj.createTHead()

Description

The createTHead() method of the HTMLTableElement object

Example

Listing 11.329 illustrates the creation of an HTMLTableElement using the HTMLBodyElement object and then the invocation of its createTHead() method.

Listing 11.329 Creating an HTMLTableElement and Invoking Its createTHead() Method

<html>
<script language="JavaScript" type="text/javascript">
<!--
var tableObj = bodyObj.createElement("table");
var tHeadObj = tableObj.createTHead();
// -->
</script>
</html>

HTMLTableElement.deleteCaption()

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableObj.deleteCaption()

Description

The deleteCaption() method of the HTMLTableElement object deletes the table caption, if one exists.

Example

Listing 11.330 illustrates the creation of an HTMLTableElement using the HTMLBodyElement object and then the invocation of its deleteCaption() method.

Listing 11.330 Creating an HTMLTableElement and Invoking Its deleteCaption() Method

<html>
<script language="JavaScript" type="text/javascript">
<!--
var tableObj = bodyObj.createElement("table");
tableObj.deleteCaption();
// -->
</script>
</html>

HTMLTableElement.deleteRow()

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableObj.deleteRow(index)

Description

The deleteRow() method of the HTMLTableElement object deletes the index table row.

Example

Listing 11.331 illustrates the creation of an HTMLTableElement using the HTMLBodyElement object and then the invocation of its deleteRow() method.

Listing 11.331 Invoking the deleteRow() Method of HTMLTableElement

<html>
<script language="JavaScript" type="text/javascript">
<!--
var tableObj = bodyObj.createElement("table");
tableObj.deleteRow(1);
// -->
</script>
</html>

HTMLTableElement.deleteTFoot()

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableObj.deleteTFoot()

Description

The deleteTFoot() method of the HTMLTableElement object deletes the footer from the table, if one exists.

Example

Listing 11.332 illustrates the creation of an HTMLTableElement using the HTMLBodyElement object and then the invocation of its deleteTFoot() method.

Listing 11.332 Creating an HTMLTableElement and Invoking Its deleteTFoot() Method

<html>
<script language="JavaScript" type="text/javascript">
<!--
var tableObj = bodyObj.CreateElement("table");
tableObj.deleteTFoot();
// -->
</script>
</html>

HTMLTableElement.deleteTHead()

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableObj.deleteTHead()

Description

The deleteTHead() method of the HTMLTableElement object deletes the header from the table, if one exists.

Example

Listing 11.333 illustrates the creation of an HTMLTableElement using the HTMLBodyElement object and then the invocation of its deleteTHead() method.

Listing 11.333 Creating an HTMLTableElement and Invoking Its deleteTHead() Method

<html>
<script language="JavaScript" type="text/javascript">
<!--
var tableObj = bodyObj.createElement("table");
tableObj.deleteTHead();
// -->
</script>
</html>

HTMLTableElement.frame

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableObj.frame

Description

The frame property of the HTMLTableElement object specifies which external table borders to render.

Example

Listing 11.334 illustrates the creation of an HTMLTableElement using the HTMLBodyElement object and then setting its frame property.

Listing 11.334 Creating an HTMLTableElement and Setting Its frame Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var tableObj = bodyObj.createElement("table");
tableObj.frame = "box";
// -->
</script>
</html>

HTMLTableElement.insertRow()

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableObj.insertRow(index)

Description

The insertRow() method of the HTMLTableElement object inserts a new empty row in the table. The new row is inserted immediately before and in the same section as the current index row in the table. If index is equal to the number of rows, the new row is appended. In addition, when the table is empty, the row is inserted into a TBODY that is created and inserted into the table.

Example

Listing 11.335 illustrates the creation of an HTMLTableElement using the HTMLBodyElement object and then the invocation of its insertRow() method.

Listing 11.335 Creating an HTMLTableElement and Invoking Its insertRow() Method

<html>
<script language="JavaScript" type="text/javascript">
<!--
var tableObj = bodyObj.createElement("table");
var rowObj = tableObj.insertRow(1);
// -->
</script>
</html>

HTMLTableElement.rows

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableObject.rows

Description

The rows property of the HTMLTableElement object returns a collection of all the rows in the table, including all in THEAD, TFOOT, and TBODY elements.

Example

Listing 11.336 illustrates the creation of an HTMLTableElement and then reading its rows property.

Listing 11.336 Reading the rows Property of the HTMLTAbleElement Object

<html>
<script language="JavaScript" type="text/javascript">
<!--
var rowsCollection = tableObj.rows;
// -->
</script>
</html>

HTMLTableElement.rules

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableObj.rules

Description

The rules property of the HTMLTableElement object specifies which internal table borders to render.

Example

Listing 11.337 illustrates the creation of an HTMLTableElement using the HTMLBodyElement object and then setting its rules property.

Listing 11.337 Creating an HTMLTableElement and Setting Its rules Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var tableObj = bodyObj.createElement("table");
tableObj.rules = "all";
// -->
</script>
</html>

HTMLTableElement.summary

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableObj.summary

Description

The summary property of the HTMLTableElement object is a description about the purpose or structure of a table.

Example

Listing 11.338 illustrates the creation of an HTMLTableElement using the HTMLBodyElement object and then setting its summary property.

Listing 11.338 Creating an HTMLTableElement and Setting Its summary Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var tableObj = bodyObj.createElement("table");
tableObj.summary = "This table has no purpose";
// -->
</script>
</html>

HTMLTableElement.tBodies

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableObj.tBodies

Description

The tBodies property of the HTMLTableElement object returns a collection of the defined table bodies.

Example

Listing 11.339 illustrates the creation of an HTMLTableElement and then reading its tBodies property.

Listing 11.339 Creating an HTMLTableElement and Reading Its tBodies Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var tBodiesCollection = tableObj.tBodies;
// -->
</script>
</html>

HTMLTableElement.tFoot

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableObj.tFoot

Description

The tFoot property of the HTMLTableElement object returns the table’s TFOOT, or Null if none exists.

Example

Listing 11.340 illustrates the creation of an HTMLTableElement using the HTMLBodyElement object and then reading its tFoot property.

Listing 11.340 Creating an HTMLTableElement and Reading Its tFoot Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var tableObj = bodyObj.createElement("table");
tableObj.tFoot;
// -->
</script>
</html>

HTMLTableElement.tHead

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableObj.tHead

Description

The tHead property of the HTMLTableElement object returns the table’s THEAD, or Null if none exists.

Example

Listing 11.341 illustrates the creation of an HTMLTableElement using the HTMLBodyElement object and then reading its tHead property.

Listing 11.341 Creating an HTMLTableElement and Reading Its tHead Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var tableObj = bodyObj.createElement("table");
tableObj.tHead;
// -->
</script>
</html>

HTMLTableElement.width

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableObj.width

Description

The width property of the HTMLTableElement object specifies the desired table width.

Example

Listing 11.342 illustrates the creation of an HTMLTableElement using the HTMLBodyElement object and then setting its width property.

Listing 11.342 Creating an HTMLTableElement and Setting Its width Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var tableObj = bodyObj.createElement("table");
tableObj.width = "100%";
// -->
</script>
</html>

HTMLTableRowElement

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

Core DOM HTML object.

Description

This object represents a row in an HTML table element. HTMLTableRowElement inherits all methods and properties from HTMLElement. Table 11.38 contains a list of properties and methods for this object.

Table 11.38 Contents of the HTMLTableRowElementObject

Image

Example

Listing 11.343 illustrates the creation of an HTMLTableRowElement using the HTMLTableElement object’s insertRow() method.

Listing 11.343 Creating an HTMLTableRowElement

<html>
<script language="JavaScript" type="text/javascript">
<!--
var rowObj = tableObj.insertRow(1);
// -->
</script>
</html>

HTMLTableRowElement.align

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableRowObj.align

Description

The align property of the HTMLTableRowElement object is the horizontal alignment of data within cells of this row.

Example

Listing 11.344 illustrates the creation of an HTMLTableRowElement using the HTMLTableElement object and then setting its align property.

Listing 11.344 Creating an HTMLTableRowElement and Setting Its align Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var rowObj = tableObj.insertRow(1); rowObj.align = "left";
// -->
</script>
</html>

HTMLTableRowElement.bgColor

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableRowObj.bgColor

Description

The bgColor property of the HTMLTableRowElement object is the background color for rows.

Example

Listing 11.345 illustrates the creation of an HTMLTableRowElement using the HTMLTableElement object and then setting its bgColor property.

Listing 11.345 Creating an HTMLTableRowElement and Setting Its bgColor Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var rowObj = tableObj.insertRow(1); rowObj.bgColor = "red";
// -->
</script>
</html>

HTMLTableRowElement.cells

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableRowObj.cells

Description

The cells property of the HTMLTableRowElement object is the collection of cells in this row.

Example

Listing 11.346 illustrates the creation of an HTMLTableRowElement and then reading its cells property.

Listing 11.346 Creating an HTMLTableRowElement and Reading Its cells Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var tableCellsCollection = rowObj.cells;
// -->
</script>
</html>

HTMLTableRowElement.ch

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableRowObj.ch

Description

The ch property of the HTMLTableRowElement object is the alignment character for cells in a column.

Example

Listing 11.347 illustrates the creation of an HTMLTableRowElement using the HTMLTableElement object and then setting its ch property.

Listing 11.347 Creating an HTMLTableRowElement and Setting Its ch Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var rowObj = tableObj.insertRow(1);
rowObj.align = "char";
rowObj.ch = ".";
// -->
</script>
</html>

HTMLTableRowElement.chOff

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableRowObj.chOff

Description

The chOff property of the HTMLTableRowElement object is the offset of alignment character.

Example

Listing 11.348 illustrates the creation of an HTMLTableRowElement using the HTMLTableElement object and then setting its chOff property.

Listing 11.348 Creating an HTMLTableRowElement and Setting Its chOff Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var rowObj = tableObj.insertRow(1);
rowObj.chOff = "3";
// -->
</script>
</html>

HTMLTableRowElement.deleteCell()

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableRowObj.deleteCell(index)

Description

The deleteCell() method of the HTMLTableRowElement object deletes a cell from the current row.

Example

Listing 11.349 illustrates the creation of an HTMLTableRowElement and then invokes its deleteCell() method.

Listing 11.349 Creating an HTMLTableRowElement and Invoking Its deleteCell() Method

<html>
<script language="JavaScript" type="text/javascript">
<!--rowObj.deleteCell(1);
// -->
</script>
</html>

HTMLTableRowElement.insertCell()

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableRowObj.insertCell(index)

Description

The insertCell() method of the HTMLTableRowElement object inserted an empty TD cell into this row. If index is equal to the number of cells, the new cell is appended.

Example

Listing 11.350 illustrates the creation of an HTMLTableRowElement using the HTMLTableElement object and then the invocation of its insertCell() method.

Listing 11.350 Invoking the insertCell() Method of the HTMLTableRowElement Object

<html>
<script language="JavaScript" type="text/javascript">
<!--
var rowObj = tableObj.insertRow(1);
var cellObj = rowObj.insertCell(2);
// -->
</script>
</html>

HTMLTableRowElement.rowIndex

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableRowObj.rowIndex

Description

The rowIndex property of the HTMLTableRowElement object is the index of this row, relative to the entire table, starting from 0. This is in document tree order and not display order. The rowIndex does not take into account sections (THEAD, TFOOT, or TBODY) within the table.

Example

Listing 11.351 illustrates the creation of an HTMLTableRowElement using the HTMLTableElement object element and then reading its rowIndex property.

Listing 11.351 Creating an HTMLTableRowElement and Reading Its rowIndex Property

<html>
<script language="JavaScript" type="text/javascript">
<!--if(rowObj.rowIndex == 1) handleFirstRow(rowObj);
// -->
</script>
</html>

HTMLTableRowElement.sectionRowIndex

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableRowObj.sectionRowIndex

Description

The sectionRowIndex property of the HTMLTableRowElement object is the index of this row, relative to the current section (THEAD, TFOOT, or TBODY), starting from 0.

Example

Listing 11.352 illustrates the creation of an HTMLTableRowElement and then reading its sectionRowIndex property.

Listing 11.352 Creating an HTMLTableRowElement and Reading Its sectionRowIndex Property

<html>
<script language="JavaScript" type="text/javascript">
<!--if(rowObj.sectionRowIndex == 1) handleFirstSectionRow(rowObj);
// -->
</script>
</html>

HTMLTableRowElement.vAlign

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableRowObj.vAlign

Description

The vAlign property of the HTMLTableRowElement object is the vertical alignment of data within cells of this row.

Example

Listing 11.353 illustrates the creation of an HTMLTableRowElement using the HTMLTableElement object and then setting its vAlign property.

Listing 11.353 Creating an HTMLTableRowElement and Setting Its vAlign Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var rowObj = tableObj.insertRow(1); rowObj.vAlign = "top";
// -->
</script>
</html>

HTMLTableSectionElement

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

Core DOM HTML object.

Description

This object represents the HTML elements THEAD, TFOOT, and TBODY. The HTMLTableSectionElement object inherits all methods and properties from HTMLElement. Table 11.39 contains a list of properties and methods for this object.

Table 11.39 Contents of the HTMLTableSectionElement Object

Image

Example

Listing 11.354 illustrates the creation of an HTMLTableSectionElement and then setting its align property.

Listing 11.354 Creating an HTMLTableSectionElement and Setting Its align Property

<html>
<script language="JavaScript" type="text/javascript">
<!--tableSectionObj.align = "char";
// -->
</script>
</html>

HTMLTableSectionElement.align

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableSectionObj.align

Description

The align property of the HTMLTableSectionElement object is the horizontal alignment of data in cells.

Example

Listing 11.355 illustrates the creation of an HTMLTableSectionElement object and then setting its align property.

Listing 11.355 Creating an HTMLTableSectionElement and Setting Its align Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
tableSectionObj.align = "char";
// -->
</script>
</html>

HTMLTableSectionElement.ch

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableSection.ch

Description

The ch property of the HTMLTableSectionElement object is the alignment character for cells in a column.

Example

Listing 11.356 illustrates the creation of an HTMLTableSectionElement and then setting its ch property.

Listing 11.356 Creating an HTMLTableSectionElement and Setting Its ch Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
tableSectionObj.align = "char";
tableSectionObj.ch = ".";
// -->
</script>
</html>

HTMLTableSectionElement.chOff

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableSectionObj.chOff

Description

The chOff property of the HTMLTableSectionElement object is the offset of alignment character.

Example

Listing 11.357 illustrates the creation of an HTMLTableSectionElement object and then setting its chOff property.

Listing 11.357 Creating an HTMLTableSectionElement and Setting Its chOff Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
tableSectionObj.align = "char";
tableSectionObj.chOff = "22";
// -->
</script>
</html>

HTMLTableSectionElement.deleteRow()

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableSectionObj.deleteRow(index)

Description

The deleteRow() method of the HTMLTableSectionElement deletes a row from this section.

Example

Listing 11.358 illustrates the creation of an HTMLTableSectionElement object and then invoking its deleteRow() method.

Listing 11.358 Creating an HTMLTableSectionElement and Invoking Its deleteRow() Method

<html>
<script language="JavaScript" type="text/javascript">
<!--
tableSectionObj.deleteRow(1);
// -->
</script>
</html>

HTMLTableSectionElement.insertRow()

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableSectionObj.insertRow(index)

Description

The insertRow() of the HTMLTableSectionElement object inserts a row into this section. The new row is inserted immediately before the current index row in this section. If index is equal to the number of rows in this section, the new row is appended.

Example

Listing 11.359 illustrates the creation of an HTMLTableSectionElement and then the invocation of its insertRow() method.

Listing 11.359 Creating an HTMLTableSectionElement and Invoking Its insertRow() Method

<html>
<script language="JavaScript" type="text/javascript">
<!--
var rowObj = tableSectionObj.insertRow(1);
// -->
</script>
</html>

HTMLTableSectionElement.rows

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableSectionObj.rows

Description

The rows property of the HTMLTableSectionElement object is the collection of rows in this table section.

Example

Listing 11.360 illustrates the creation of an HTMLTableSectionElement and then reading its rows property.

Listing 11.360 Reading the rows Property of the HTMLTableSectionElement Object

<html>
<script language="JavaScript" type="text/javascript">
<!--
var rowsCollection = tableSectionObj.rows;
// -->
</script>
</html>

HTMLTableSectionElement.vAlign

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTableSectionObj.vAlign

Description

The vAlign property of the HTMLTableSectionElement object is the vertical alignment of data in cells.

Example

Listing 11.361 illustrates the creation of an HTMLTableSectionElement and then setting its vAlign property.

Listing 11.361 Creating an HTMLTableSectionElement and Setting Its vAlign Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
tableSectionObj.align = "char";
tableSectionObj.vAlign = "top";
// -->
</script>
</html>

HTMLTextAreaElement

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

Core DOM HTML object.

Description

This object represents an HTML multi-line text field. HTMLTextAreaElement inherits all properties and methods from HTMLElement. Table 11.40 contains a list of properties and methods for this object.

Table 11.40 Contents of the HTMLTextAreaElement Object

Image

Example

Listing 11.362 illustrates the creation of an HTMLTextAreaElement using the HTMLFormElement object.

Listing 11.362 Creating an HTMLTextAreaElement

<html>
<script language="JavaScript" type="text/javascript">
<!--
var textAreaObj = formObj.createElement("textarea");
// -->
</script>
</html>

HTMLTextAreaElement.accessKey

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTextAreaObj.accessKey

Description

The accessKey property of the HTMLTextAreaElement object is a single character access key to give access to the form control.

Example

Listing 11.363 illustrates the creation of an HTMLTextAreaElement using the HTMLFormElement object element and then setting its accessKey property.

Listing 11.363 Creating an HTMLTextAreaElement and Setting Its accessKey Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var textAreaObj = formObj.createElement("textarea");
textAreaObj.accessKey = "q";
// -->
</script>
</html>

HTMLTextAreaElement.blur()

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTextAreaObj.blur()

Description

The blur() method of the HTMLTextAreaElement object removes keyboard focus from this element.

Example

Listing 11.364 illustrates the creation of an HTMLTextAreaElement using the HTMLFormElement object element and then the invocation of its blur() method.

Listing 11.364 Creating an HTMLTextAreaElement and Invoking Its blur() Method

<html>
<script language="JavaScript" type="text/javascript">
<!--
var textAreaObj = formObj.createElement("textarea");
textAreaObj.blur();
// -->
</script>
</html>

HTMLTextAreaElement.cols

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTextArea.cols

Description

The cols property of the HTMLTextAreaElement object is the width of control (in characters).

Example

Listing 11.365 illustrates the creation of an HTMLTextAreaElement using the HTMLFormElement object and then setting its cols property.

Listing 11.365 Creating an HTMLTextAreaElement and Setting Its cols Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var textAreaObj = formObj.createElement("textarea");
textAreaObj.cols = 25;
// -->
</script>
</html>

HTMLTextAreaElement.defaultValue

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTextAreaObj.defaultValue

Description

The defaultValue of the HTMLTextAreaElement object represents the contents of the element. The value of this attribute doesn’t change if the contents of the corresponding form control, in an interactive user agent, changes. Changing this attribute, however, resets the contents of the form control.

Example

Listing 11.366 illustrates the creation of an HTMLTextAreaElement using the HTMLFormElement object and then setting its defaultValue property.

Listing 11.366 Creating an HTMLTextAreaElement and Setting Its defaultValue Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var textAreaObj = formObj.createElement("textarea");
textAreaObj.defaultValue = "some default text";
// -->
</script>
</html>

HTMLTextAreaElement.disabled

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTextAreaObj.disabled

Description

The disabled property of the HTMLTextAreaElement object is used to disable the textarea instance.

Example

Listing 11.367 illustrates the creation of an HTMLTextAreaElement using the HTMLFormElement object and then setting its disabled property.

Listing 11.367 Creating an HTMLTextAreaElement and Setting Its disabled Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var textAreaObj = formObj.createElement("textarea");
textArea.disabled = false;
// -->
</script>
</html>

HTMLTextAreaElement.focus()

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTextAreaObj.focus()

Description

The focus() method of the HTMLTextAreaElement object gives keyboard focus to this element.

Example

Listing 11.368 illustrates the creation of an HTMLTextAreaElement using the HTMLFormElement object and then the invocation of its focus() method.

Listing 11.368 Creating an HTMLTextAreaElement and Invoking Its focus() Method

<html>
<script language="JavaScript" type="text/javascript">
<!--
var textAreaObj = formObj.createElement("textarea");
textAreaObj.focus();
// -->
</script>
</html>

HTMLTextAreaElement.form

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTextAreaObj.form

Description

The form property of the HTMLTextAreaElement object returns the FORM element containing this control. Returns Null if this control isn’t within the context of a form.

Example

Listing 11.369 illustrates the creation of an HTMLTextAreaElement using the HTMLFormElement object and then reading its form property.

Listing 11.369 Creating an HTMLTextAreaElement and Reading Its form Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var textAreaObj = formObj.createElement("textarea");
if(textAreaObj.form.name == "emailForm")
  processEmailForm(textAreaObj.form);
// -->
</script>
</html>

HTMLTextAreaElement.name

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTextAreaObj.name

Description

The name property of the HTMLTextAreaElement object is the form control or object name when submitted with a form.

Example

Listing 11.370 illustrates the creation of an HTMLTextAreaElement using the HTMLFormElement object and then setting its name property.

Listing 11.370 Creating an HTMLTextAreaElement and Setting Its name Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var textAreaObj = formObj.createElement("textarea");
textAreaObj.name = "blurb";
// -->
</script>
</html>

HTMLTextAreaElement.readOnly

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTextAreaObj.readOnly

Description

The readOnly property of the HTMLTextAreaElement object indicates whether or not this control is read-only.

Example

Listing 11.371 illustrates the creation of an HTMLTextAreaElement using the HTMLFormElement object element and then setting its readOnly property.

Listing 11.371 Creating an HTMLTextAreaElement and Setting Its readOnly Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var textAreaObj = formObj.createElement("textarea");
textAreaObj.value = "Some readonly text";
textAreaObj.readOnly = true;
// -->
</script>
</html>

HTMLTextAreaElement.rows

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTextAreaObj.rows

Description

The rows property of the HTMLTextAreaElement object is the number of text rows in the text area.

Example

Listing 11.372 illustrates the creation of an HTMLTextAreaElement using the HTMLFormElement object and then setting its rows property.

Listing 11.372 Creating an HTMLTextAreaElement and Setting Its rows Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var textAreaObj = formObj.createElement("textarea");
textAreaObj.cols = 25;
textAreaObj.rows = 10;
// -->
</script>
</html>

HTMLTextAreaElement.select()

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTextAreaObj.select()

Description

The select() method of the HTMLTextAreaElement object selects the contents of the TEXTAREA.

Example

Listing 11.373 illustrates the creation of an HTMLTextAreaElement using the HTMLFormElement object and then the invocation of its select() method.

Listing 11.373 Creating an HTMLTextAreaElement and Invoking Its select() Method

<html>
<script language="JavaScript" type="text/javascript">
<!--
var textAreaObj = formObj.createElement("textarea");
textAreaObj.value = "some text";
textAreaObj.select();
// -->
</script>
</html>

HTMLTextAreaElement.tabIndex

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTextAreaObj.tabIndex

Description

The tabIndex property of the HTMLTextAreaElement object is the index that represents the element’s position in the tabbing order.

Example

Listing 11.374 illustrates the creation of an HTMLTextAreaElement using the HTMLFormElement object and then setting its tabIndex property.

Listing 11.374 Creating an HTMLTextAreaElement and Setting Its tabIndex Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var textAreaObj = formObj.createElement("textarea");
textAreaObj.tabIndex = 3;
// -->
</script>
</html>

HTMLTextAreaElement.type

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTextAreaObj.type

Description

The type property of the HTMLTextAreaElement object is the type of this form control. This is the string "textarea".

Example

Listing 11.375 illustrates the creation of an HTMLTextAreaElement using the HTMLFormElement object and then reading its type property.

Listing 11.375 Creating an HTMLTextAreaElement and Reading Its type Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var textAreaObj = formObj.createElement("textarea");
display(textAreaObj.type);
// -->
</script>
</html>

HTMLTextAreaElement.value

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTextAreaObj.value

Description

The value property of the HTMLTextAreaElement object represents the current contents of the corresponding form control, in an interactive user agent. Changing this attribute changes the contents of the form control, but doesn’t change the contents of the element. If the entirety of the data cannot fit into a single string, the implementation might truncate the data.

Example

Listing 11.376 illustrates the creation of an HTMLTextAreaElement using the HTMLFormElement object and then setting its value property.

Listing 11.376 Creating an HTMLTextAreaElement and Setting Its value Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var textAreaObj = formObj.createElement("textarea");
textAreaObj.value = "Some random text";
// -->
</script>
</html>

HTMLTitleElement

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

Core DOM HTML object.

Description

This object represents the document title. HTMLTitleElement inherits all properties and methods from HTMLElement. The property for this object is as follows:

Image

Example

Listing 11.377 illustrates the creation of an HTMLTitleElement using the HTMLHeadElement object element.

Listing 11.377 Creating an HTMLTitleElement

<html>
<script language="JavaScript" type="text/javascript">
<!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc");
htmlDoc.open();
var headElement = htmlDoc.createElement("head");
var titleElement = htmlDoc.createElement("title");


// -->
</script>
</html>

HTMLTitleElement.text

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlTitleObj.text

Description

The title property of the HTMLTitleElement object represents the specified title of an HTML document.

Example

Listing 11.378 illustrates the creation of an HTMlTitleElement using the HTMLHeadElement object element and then setting its text property.

Listing 11.378 Creating an HTMLTitleElement and Setting Its text Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var htmlDoc = HTMLDOMImplementation.createHTMLDocument("My HTML Doc");
htmlDoc.open();
var headElement = htmlDoc.createElement("head");
var titleElement = htmlDoc.createElement("title");
titleElement.text = "My New HTML Doc Title";
// -->
</script>
</html>

HTMLUListElement

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

Core DOM HTML object.

Description

This object represents an HTML unordered list element. HTMLUListElement inherits all properties and method of HTMLElement. Table 11.41 contains a list of properties for this object.

Table 11.41 Properties of the HTMLUListElement Object

Image

Example

Listing 11.379 illustrates the creation of an HTMLUListElement using the HTMLBodyElement.

Listing 11.379 Creating an HTMLUListElement

<html>
<script language="JavaScript" type="text/javascript">
<!--
var ulObj = bodyObj.CreateElement("ul");
// -->
</script>
  </html>

HTMLUListElement.compact

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlUListObj.compact

Description

The compact property of the HTMLUListElement object reduces spacing between list items.

Example

Listing 11.380 illustrates the creation of an HTMLUListElement using the HTMLBodyElement object and then setting its compact property.

Listing 11.380 Creating an HTMLUListElement and Setting Its compact Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var ulObj = bodyObj.CreateElment("ul");
ulObj.compact = true;
// -->
</script>
</html>

HTMLUListElement.type

JavaScript 1.5+, JScript 5+

Nav6+, IE5+

 

Syntax

htmlUListObj.type

Description

The type property of the HTMLUListElement object is the bullet style of the element.

Example

Listing 11.381 illustrates the creation of an HTMLUListElement using the HTMLBodyElement object and then setting its type property.

Listing 11.381 Creating an HTMLUListElement and Setting Its type Property

<html>
<script language="JavaScript" type="text/javascript">
<!--
var ulObj = bodyObj.CreateElement("ul");
ulObj.type = "bullet";
// -->
</script>
</html>

ON THE CD-ROM

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.84.112