-1
How do I get only the amount (R$11,20)?
<td class="monetary" databind = "text: value label, visible: $parent.isShippingKnown()">R$11,20 </td>
It didn’t work, and there’s this other structure, I just need the text: "R$ 8,62 - Up to 8 business days"
<span data-bind="text: maxEstimateOptionText">Econômica - R$ 8,62 - Até 8 dias úteis</span>
$('#Econômica').text(); // Retorna
$('#Convencional).text(); // Retorna
$('#Rápida).text(); //Retorna
$('#Entrega Agendada I Convencional').text(); // Não Retorna
$('#Entrega Agendada I Sábado').text(); // Não retorna
<li data-bind="attr: {'class': idAttr}, css: { selected: name == $parent.selectedSlaName() }" class="seller-BTP-sla-EntregaAgendadaISabado">
<a href="javascript:void(0)" data-bind="click: function() { $parent.selectedSlaName(name) }, attr: { 'id': name }" id="Entrega Agendada I Sábado">
<i class="icon-ok" data-bind="visible: name == $parent.selectedSlaName()" style="display: none;"></i>
<span data-bind="text: maxEstimateOptionText">Entrega Agendada I Sábado - A partir de R$ 76,20 - Primeira data em 06/08/2016</span>
</a>
</li>
<a href="javascript:void(0)" data-bind="click: function() { $parent.selectedSlaName(name) }, attr: { 'id': name }" id="Entrega Agendada I Sábado">
<i class="icon-ok" data-bind="visible: name == $parent.selectedSlaName()" style="display: none;"></i>
<span data-bind="text: maxEstimateOptionText">Entrega Agendada I Sábado - A partir de R$ 76,20 - Primeira data em 06/08/2016</span>
</a>
<i class="icon-ok" data-bind="visible: name == $parent.selectedSlaName()" style="display: none;"></i>
<span data-bind="text: maxEstimateOptionText">Entrega Agendada I Sábado - A partir de R$ 76,20 - Primeira data em 06/08/2016</span>
Do you have access to the server code that generates this HTML? so you could pass it in an attribute
data-
and it was much safer and easier.– Sergio
Just a curiosity: If you want to capture the text from within a select only from the one that was selected the code would be as follows: var text = $('#id_do_select :Selected'). text();
– Dierp