Dimitri Danilov Dimitri Danilov - 8 months ago 32
jQuery Question

How can I insert before a text without having any marker?

I have this html :

<th class="fc-day-header fc-widget-header fc-sat" data-date="2016-10-01">samedi 1 octobre</th>

And I want to insert something before
samedi 1 octobre

I already tried prepend() but it doesn't seems to work; the text disappears.

Have any ideas?


You can just add to the text that is already there

$('.fc-day-header.fc-widget-header.fc-sat').text(function(_,txt) {
    return 'Some text' + txt;