I am trying to pass a table variable as a mailto subject.
I am using this script to do for a div ID, but unsure how to to do this for a class - getElementsByClassName
doesn't work. How Do I do this?
Button:
<button name="mail_button" onclick="mail_content()">Mail</button>
Script:
function mail_content() {
var tableContent = document.getElementById("mailcontent").innerHTML;
var mBody = "" + tableContent + "";
document.location.href = "mailto:test@domain.com?subject=Titel&body=" + mBody;
}
Element I wish to fect the varable from:
<td class="mailcontent">N7P47AA</td>