this is the label, having text = Use 20 kms
using jquery i want to Replace the text "20 Kms" with 10 kms"
I get the hand to label like this
$("label[for='applyDistanceSlab']");
how can i do that...
You can also use the jQuery html() method to change the text of a label. If I want to change the text inside the label from “First Name:” to “Name:”, I can use the jQuery text() method to do this with the following Javascript code. We can also use the jQuery html() method to change the content of a span.
$("label[for='applyDistanceSlab']").text("10 kms");
$("label[for='applyDistanceSlab']").text('use 10 kms');
LIVE DEMO
text:
Description: Get the combined text contents of each element in the set of matched elements, including their descendants.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With