SO - 16234211
by Arun P Johny
HTML
<table>
<tbody>
<tr>
<td style="text-align: right; width: auto; padding: 8px 0px;"><nobr>Ref.</nobr>:
</td>
<td class="ext04"
style="white-space: nowrap; width: 12%; font-weight: bold;">EUR
<strong><div nowrap=nowrap id="quote"
class="realtimeDetailLayer" source="lightstreamer"
style="display: inline" table="LS_ProductDetails_TabID"
item="X0000010600NL0010379129" field="reference">350,85</div></strong>
</td>
<td style="text-align: right; width: auto; padding: 8px 0px;"><nobr>Bied</nobr>:
</td>
<td class="ext04"
style="white-space: nowrap; width: 12%; font-weight: bold;">EUR
<div nowrap=nowrap id="quote" class="realtimeDetailLayer"
source="lightstreamer" style="display: inline"
table="LS_ProductDetails_TabID" item="X0000010600NL0010379129"
field="bid">0,28</div>
</td>
<td style="text-align: right; width: auto; padding: 8px 0px;"><nobr>Laat</nobr>:
</td>
<td class="ext04"
style="white-space: nowrap; width: 12%; font-weight: bold;">EUR
<div nowrap=nowrap id="quote" class="realtimeDetailLayer"
source="lightstreamer" style="display: inline"
table="LS_ProductDetails_TabID" item="X0000010600NL0010379129"
field="ask">0,29</div>
</td>
<td style="text-align: right; width: auto; padding: 8px 0px;"><nobr>%</nobr>:
</td>
<td class="ext04"
style="white-space: nowrap; width: 12%; font-weight: bold;"><div
nowrap=nowrap id="quote" class="realtimeDetailLayer"
source="lightstreamerGeneratedValues" style="display: inline"
table="LS_ProductDetails_TabID" item="X0000010600NL0010379129"
field="midchangepercent">
<span class="extNegative"><nobr>-50,88 %</nobr></span>
</div></td>
</tr>
</tbody>
</table>
JavaScript
var divs = document.getElementsByTagName('div');
function getQuoteHtml(key){
var i;
for(i =0 ; i < divs.length; i++){
if(divs[i].getAttribute('field') == key){
return divs[i].innerHTML;
}
}
}
console.log(getQuoteHtml('reference'))