Reputation: 20736
i 've the following html:
<table id="mytable">
<thead>
</thead>
<tbody>
<tr>
<td><a href="#" onclick="doSometThingCrazy(); return false;">test</a></td>
</tr>
</tbody>
</table>
Now i want to get all links inside this table with dojo. So far so good:
dojo.query("#mytable a").forEach(
function(item){
dojo.connect(item, 'onmouseover', function(){
console.log(item);
console.log('x');
});
}
);
Now i want to get the text for the href (test) and look for it in an other table. Is there anyway to access this value ?
Upvotes: 0
Views: 1225
Reputation: 536715
If you just want text and no HTML markup to worry about, use:
dojo.dom.textContent(item)
Upvotes: 2
Reputation: 15509
You can check its innerHTML, I do not know any css selector for its innerHTML.
dojo.query("#mytable a").forEach(
function(item){
if(dojo.attr(item, "innerHTML") == "TEXT")
dojo.connect(item, 'onmouseover', function(){
console.log(item);
console.log('x');
});
}
);
Upvotes: 0