How to append text at the begin using function appendText?
For example:
HTML:
<div id="myElement">Hey.</div>
JavaScript:
$('myElement').appendText('Howdy. ', 'before');
Expected result: Howdy. Hey.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you read the documentation I believe you can achieve it using the following:
which produces this
Using
'before'will append the first param immediately before the<div />tags:Using
'top'will append the first param immediately after the opening<div>tag: