Copyright © tutorialspoint.com
The <setvar> element is used as a result of the user executing some task. The >setvar> element can be used to set a variable's state within the following elements: <go>, <prev>, and <refresh>.
This element supports the following attributes:
| Attribute | Value | Description |
|---|---|---|
| name | string | Sets the name of the variable |
| value | string | Sets the value of the variable |
| class | class data | Sets a class name for the element. |
| id | element ID | A unique ID for the element. |
The following element would create a variable named a with a value of 1000:
<setvar name="a" value="1000"/> |
Following is another example showing usage of this element.
<?xml version="1.0"?> <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN" "http://www.wapforum.org/DTD/wml12.dtd"> <wml> <card> <p> <anchor> Go to next chapter <go href="#chapter2"> <setvar name="x" value="30"/> </go> </anchor> </p> </card> </wml> |
Copyright © tutorialspoint.com