I have this button which when clicked opens outlook with the details i have provided. I also have a TEXTAREA which is holding certain texts. I'm looking for a way to have this text appear in the body of my outlook. Can this be done.? Please find code below -
<script type="text/javascript">
$(function () {
$('.btnSendEmail').click(function (event) {
var email = 'MyemailID@email.com';
var subject = 'Creation Checklist';
var emailBody = 'Body';
window.location = 'mailto:' + email + '?subject=' + subject + '&body=' + emailBody;
});
});
</script>
<div id="container">
<TEXTAREA ID="holdtext" rows="10" cols="70">
</TEXTAREA><br><br>
function ChangeFunction() {
holdtext.innerText = appchange.innerText;
}
Try changing this line:
var emailBody = 'Body';
To:
var emailBody = $('#holdtext').val();
Because textarea
is a form element.. val()
is the proper way to retrieve the text inside of it.
Let me know if this helps!