Ask a Question

Fetch the id from the select tag inside the table tr td in javascript

SOLVED
vsubbu
New Contributor

Fetch the id from the select tag inside the table tr td in javascript

Can you please help me in fetching the id and token id from the below select tag

 

<table>

<tbody>

<tr>

<td>

<select tabindex="-1"  id="c2bed32656751f63620b" aria-hidden="true" tokenid="1a4a9ea8-2043-4447-9634-de03fca5fb26">
    <option value="">Actions</option>
    <option value="documents">Documents</option>
    <option value="continue">Edit </option> 
</select>
<span class="select2 select2-container select2-container--bootstrap js-dropdown-actions-template js-dropdown-actions js-dropdown-actions-events" id="s2id_c2bed326-2233-4642-b046-56751f63620b" dir="ltr">

</td>

</tr>

<tr>

<td>

<select id="xxx" tokenid="xxx">

</td>

</tr>

 

2 REPLIES 2
TanyaYatskovska
SmartBear Alumni (Retired)

Hi @vsubbu,

I would suggest that you treat your HTML as XML. In this case, you can use XPAth to easily get the needed attribute. Please refer to the following article  for more information:

https://support.smartbear.com/testcomplete/docs/testing-with/advanced/working-with-external-data-sou...

 

Community, your suggestions?

---------
Tanya Yatskovskaya
SmartBear Community and Education Manager



Thanks. 

cancel
Showing results for 
Search instead for 
Did you mean: