WML Elements and Attributes

The following is a brief summary of the elements and attributes in the WML 1.2 Specification (the latest version as of this writing). Because it is new, not all browsers support the entire specification, so be sure to test your applications.

There are a few core attributes that can be used in nearly every element:

<a>

<a>...</a>

Specifies a link to another resource (a specific card or another wml document).

Attributes

<access>

<access/> 

Specifies a domain name. Only documents (decks) originating from that domain name can access the current document. The <access> element is contained within <head> tags.

Attributes

<anchor>

<anchor>...</anchor>

Specifies a generic link to another resource. It can be used in conjunction with the <go> and <prev> elements.

Attributes

<b>

<b>...</b>

Specifies bold text.

<big>

<big>...</big> 

Specifies text that is slightly larger than the default text.

<br>

<br/>

Indicates a line break within the flow of text.

<card>

<card>...</card>

The unit within the WML document that displays in the device. Cards are logical divisions of the application's functionality.

Attributes

<do>

<do>...</do> 

Describes an action within the current card, generally assigned to a softkey on the device. The action is indicated by the elements <go>, <prev>, <noop>, or <refresh> within the <do> element.

Attributes

<em>

<em>...</em>

Specifies emphasized text (display is browser-dependent).

<fieldset>

<fieldset>...</fieldset>

Defines logical sections within content. It is currently poorly supported.

Attributes

<go>

<go/>

Specifies a task that navigates to a resource (like a link). The xml:lang attribute is not allowed in this element.

Attributes

<head>

<head>...</head>

Specifies an optional header for the document.

<i>

<i>...</i> 

Specifies italic text.

<img>

<img/> 

Inserts an image into the content flow.

Attributes

<input>

<input/>

Adds a text-entry field to the document.

Attributes

<meta>

<meta/> 

Provides information about the document; it is placed within the <head> element.

Attributes

<noop>

<noop/>

Specifies that nothing should be done. Can disable functionality in the browser.

<onevent>

<onevent/>

Triggers an action based on a specified event.

Attributes

<option>

<option>...</option> 

Specifies one selection within a <select> list.

Attributes

<optgroup>

<optgroup>...</optgroup> 

Deliminates groups of <option>s within a <select> list.

Attributes

<p>

<p>...</p>

Specifies a paragraph of text.

Attributes

<postfield>

<postfield/> 

Specifies name-value pairs to send to the server.

Attributes

<prev>

<prev>...</prev> or<prev/>

Instructs the browser to go back in its history stack to the previously viewed card. The standard attribute xml:lang is not permitted in this element.

<refresh>

<refresh>...</refresh> 

Specifies a refresh task, which updates the browser context (clears history and stored variables).

<select>

<select>...<select> 

Indicates a list of options in a form. The <select> element contains some number of <option> elements and may also contain <optgroup>s.

Attributes

<setvar>

<setvar/> 

Specifies the name-value pair for a variable. If a variable already exists, it is overwritten. The <setvar> element may only be used within <refresh> and <go> tags.

Attributes

<small>

<small>...</small> 

Specifies that enclosed text should be slightly smaller than the default text size.

<strong>

<strong>...</strong> 

Indicates strongly emphasized text. How it is rendered is device-dependent.

<table>

<table>...</table> 

Indicates the beginning and end of a table.

Attributes

<td>

<td>...</td>

Defines an individual cell in a table. The contents of the cell are placed within <td> container tags.

<template>

<template>...</template>

Specifies a template for all the cards in the deck, including <do> elements for softkey behaviors.

<timer>

<timer/> 

Sets a timer that can be used to trigger events when it expires.

Attributes

<tr>

<tr>...</tr> 

Indicates a row within a table. Its contents are some number of <td> elements (table cells). The xml:lang attribute is not associated with this element.

<u>

<u>...</u> 

Specifies underlined text.

<wml>

<wml>...</wml> 

Indicates the beginning and end of a deck. It is the root element of a WML document (deck).