Text after "
How can I change "2 year subscription" "2 years:" without losing input area <
& lt; Div class = "radioOption subscription1col3" & gt; & Lt; Input class = "buyNow" type = "radio" name = "product2" value = "6_0" check = "" & gt; 2 year subscription & lt; / Div & gt; It is relatively simple, and I give the following suggestions (though currently untested): var input = $ ('. RadioOption Subscription 1Col3 input'), text = input [0] .nextSibling .nodeValue, newText = text.replace (/ membership / i, ':'); Input [0] .nextSibling.nodeValue = newText; .
Or maybe this version may be preferred, because this adjusted text wrapped in a label element, which leaves UI and AIDs, it is easy to target that text content in the future Creates: var input = $ ('# inputID'), label = $ ('& lt; label / & gt;', '' for ':' inputID '}). Text (input [0] .nextSibling.nodeValue.replace (/ membership / i, ':')); Input.parent () Empty (). Attached (input, label); .
However, input requires a id attribute, so that label that input Related.
Comments
Post a Comment