loriensleafs
loriensleafs

Reputation: 2255

jQuery email onclick with email title

with jquery how would you set up div so that when you click on it, it takes the content of a child div, opens up a new e-mail and makes that contents the title of the e-mail.

Below is the div structure, and below that is the javascript I started, but I just have no idea how to do the email part.

<div class="additional_item_container">
    <div class="additional_item_name">Carlo De March, Venezia, c. 1953</div>
</div>


$(".instrument_container").click(function () {
    var email_title = $(this).find(".additional_item_name");

)};

Upvotes: 0

Views: 1338

Answers (1)

Brian Salta
Brian Salta

Reputation: 1576

Something like this would work...

$(".additional_item_container").click(function () {
    var email_title = $(this).find(".additional_item_name").html();
    window.location.href = "mailto:[email protected]?subject=" + email_title;
});

Upvotes: 2

Related Questions