1

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.

udalmik
  • 7,838
  • 26
  • 40

2 Answers2

3

http://minifiedjs.com/docs/howto.html#html_text

$('.myRef').fill("My new text");

I get it right from documentation.

Jan.J
  • 3,050
  • 1
  • 23
  • 33
2

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.

Scott
  • 21,211
  • 8
  • 65
  • 72