Welcome aboard! We are happy you are here and wish you good net-raft!
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-2.1.3.min.js " type="text/javascript"></script>
</head>
<body>
<textarea id="textarea" rows="10" cols="20">focus the pointer before or behind text and click button</textarea></br>
<button id="addurl">addurl</button>
<script type="text/javascript">
$(document).ready(function(){
$("#addurl").click(function () {
var x = location.href;
var $txt = $("#textarea");
var caretPos = $txt[0].selectionStart;
var textAreaTxt = $txt.val();
var txtToAdd = x;
$txt.val(textAreaTxt.substring(0, caretPos) + txtToAdd + textAreaTxt.substring(caretPos) );
});
});
</script>
</body>
</html>
The most helpful JQUERY solutions