0

以下の例のように、USPS からの XML フィードによって動的に生成されるラジオ ボタン リストがあります。

<div id="pnlCartAllowsShippingMethodSelection">
    <span id="ShipSelectionMsg"><p><b>Please select the desired shipping method below:</b></p></span>
    <input type="radio" name="ShippingMethodID" id="ShippingMethodID3" value="41|Express Mail International|55.60|0.00">&nbsp;Express Mail International $55.60 (USD)<span id="shippingdescription"> - Delivery in 3-5 Business Days*</span><br>
    <input type="radio" name="ShippingMethodID" id="ShippingMethodID3" value="9|Priority Mail International|42.58|0.00">&nbsp;Priority Mail International $42.58 (USD)<span id="shippingdescription"> - Delivery in 6-10 Business Days*</span><br>
    <input type="radio" name="ShippingMethodID" id="ShippingMethodID3" value="67|First-Class Package International Service<sup>TM</sup>**|19.53|0.00">&nbsp;First-Class Package International Service<sup>™&lt;/sup>** $19.53 (USD)<br>
    <input type="hidden" name="RequireShippingSelection" value="true">
</div>

<inputs>すべてをループしてタグを見つけ<sup>TM</sup>、フィールドから削除したいと思いvalueます。

関数を使用する必要があると思い.each()ます。各関数内で使用する関数がわからない

$('#pnlCartAllowsShippingMethodSelection input").each(function() {
    $(this).
});
4

2 に答える 2

5

使用できます.remove()

$('#pnlCartAllowsShippingMethodSelection sup').remove();

ラジオ ボタンの場合は、次のようにすることができます。

$('#pnlCartAllowsShippingMethodSelection input').val(function(index, value) {
    return value.replace(/<sup>TM<\/sup>/g, '');
});
于 2013-02-05T23:44:27.167 に答える
1
$('#pnlCartAllowsShippingMethodSelection sup").remove()
于 2013-02-05T23:45:03.413 に答える