JSFiddle - React, Tailwind, and code Playground
HTML
<a class="text-btn" href="#"
data-text="Application submitted by applicant - Demande Presentee par requerant">
[sub by appl]
</a>
<a class="text-btn" href="#"
data-text="Application submitted by a third party - Demande presentee par une tierce partie">
[sub by 3rd party]
</a>
<form name="textform" id="textform">
<font face="Arial, Helvetica, sans-serif" size="2">
<textarea name="textarea" cols="100" rows="15"></textarea>
</font>
</form>
<script type="text/javascript">
(function() {
var form = document.getElementById('textform'),
textarea = form['textarea'],
anchors = document.getElementsByTagName('a');
function insertText() {
textarea.value += this.getAttribute('data-text') + "\n";
return false;
}
for(var i = 0, l = anchors.length; i < l; i++) {
if(anchors[i].className == 'text-btn') {
anchors[i].onclick = insertText;
}
}
})();
</script>
CSS
a {
margin: 5px;
text-decoration: none;
}0