I have a text input with a label:
<li data-role="fieldcontain">
<label for="number">Amount:</label>
<input type="number" name="number" id="vitalamount" value="" />
</li>
I’m now trying to change the label of the input, but the following code didn’t work.
$("#vitalamount").attr("label","something else");
attrmodifies the attributes of an element not it’s sibling elements, you can useprev()orsiblingsfor selecting thelabeland changing it’s texts: