What is the right way to update text of a element with minifiedjs?
E.g.
<a class="myRef">Old text</a>
I have tried logical:
$('.myRef').text('New text');
But it doesn't work.
What is the right way to update text of a element with minifiedjs?
E.g.
<a class="myRef">Old text</a>
I have tried logical:
$('.myRef').text('New text');
But it doesn't work.
You can use the fill
method to replace the existing text value.
$('.myRef').fill("New Text Value");
or you can use the add
method to append text to the existing text.
$('.myRef').add("Append Text");
(The text
method returns the concatenated text content of all nodes in the list.)
This list of How To's is helpful for learning how to use minifiedjs.
http://minifiedjs.com/docs/howto.html#html_text
I get it right from documentation.