jquery - Replacing a string inside a a tag with a different string of text -
i know should simple can't make work. have text inside tag need change. it's rendered cms can't change on end. here html.
<a href="/orderretrievev2.aspx?catalogueid=105038" class="cartsummarylink">view cart</a>
i need change "view cart" "view summary". here trying use jquery.
$'a.cartsummarylink').text().replace("view cart" , "view summary");
it's not working. in advance our suggestions!
i'm not sure if copy-pase error, need have opening (
on $()
function. otherwise syntax error. then, there no need call .replace()
, .text()
both getter , setter, can pass "view summary"
.text()
, , change element's text.
like so:
$('a.cartsummarylink').text("view summary");
Comments
Post a Comment