I want add text in a div element that already has a text. I used .append() but this will put the text after the text that already is inside. I want to append the text before the text that already is inside. =)
But how?
Use .prepend to add before the existing content.
.prepend( content [, content ] ) - Insert content, specified by the parameter, to the beginning of each element in the set of matched elements.
You are looking at prepend()
Example:-
$('selectorContainer').prepend('Text to appear first or element selector or element itself inside the selectorContainer');
See Doc