I get the error "Object doesn't support this property or method" at the line document.getElementByID("lblDescription").firstChi ld.nodeValue = aPackageDescriptions[i]. Here is the code.
Expand|Select|Wrap|Line Numbers
- <script language="JavaScript">
- var aPackageDescriptions = new Array()
- aPackageDescriptions[0] = "Rollin VIP"
- aPackageDescriptions[1] = "Don't be late."
- function ShowDescription(i)
- {
- document.getElementByID("lblDescription").firstChild.nodeValue = aPackageDescriptions[i]
- }
- </script>
- <table>
- <tr>
- <th>Package Plan</th>
- <td>
- <select name="ddlPackagePlan" onChange="ShowDescription(ddlPackagePlan.selectedIndex)">
- <option value="1">Test Package</option>
- <option value="2">Meet me at the gate.</option>
- </select>
- </td>
- </tr>
- <tr>
- <th> </th>
- <td>
- <fieldset>
- <legend>Description</legend>
- <div id="lblDesciption"> </div>
- </fieldset>
- </table>