Adding selected value to a table td element

519
2
Jump to solution
05-02-2012 08:10 AM
SamirGambhir
Occasional Contributor III
Hi,
I have a dijit.form.FilteringSelect element with a few options. Once a selection is made, the user clicks a button to add the selected value to <td> element of a table. It was fairly easy to get a handle on the selected value, but I am not sure how to get a handle on the 'td' element of the table so that the selected value can be added to its innerHTML. please help.
Thanks
Samir
0 Kudos
1 Solution

Accepted Solutions
PaulBushore
Occasional Contributor
Hello,

I don't know if this will work for your item, but with most elements you can assign an id to it.  For your particular item:

[HTML]<table>
  <tr>
    <td id="myTD">
    innerHTML
    </td>
  </tr>
</table>[/HTML]

Then you can have a function find the element by id and set the innerhtml

dojo.byId("myTD").innerHTML = "whatever";


I think this would work.

Best wishes!

View solution in original post

0 Kudos
2 Replies
PaulBushore
Occasional Contributor
Hello,

I don't know if this will work for your item, but with most elements you can assign an id to it.  For your particular item:

[HTML]<table>
  <tr>
    <td id="myTD">
    innerHTML
    </td>
  </tr>
</table>[/HTML]

Then you can have a function find the element by id and set the innerhtml

dojo.byId("myTD").innerHTML = "whatever";


I think this would work.

Best wishes!
0 Kudos
SamirGambhir
Occasional Contributor III
Thanks,
That worked,
Samir
0 Kudos