Getting a div using js?

Hi, can you help?



<title>test</title>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>




 <div id="reference"> 
 <p>parameter 1</p>
 <p>parameter 2</p>
 <p>option 3</p>
</div>

<script type="text/javascript">
 var email=('mail@.ru');
 var subject = ('rederence');
 var body = $('#reference').HTML();
 document.write('<a href="mailto:' + email +'?subject=' +subject+ '&body=' +body+ '">' + 'Send' + '<'+'/a>');
</script>




I have a div block reference.
I want to do to when you click on send, in the body of the email was html, no tags to display this in the letter as in the browser.

text is not suitable if the html to use the content tags are inserted.

Help!
July 9th 19 at 11:20
3 answers
July 9th 19 at 11:22
July 9th 19 at 11:24
Cunning what!
and how to do? I need to pass these parameters to the body pisma - Marjor commented on July 9th 19 at 11:27
: this is done with php - Tatum_White21 commented on July 9th 19 at 11:30
July 9th 19 at 11:26
You can use textContent.
The problem is how these data will be used. If you need read-only operator, then fine if it will handle some script — then you have to find another way (if you need help).
But it is better to use form tag.

So, replace the 19-th line to:
var body = $('#reference').text();
implemented through Innerhtml. Thank you! - Marjor commented on July 9th 19 at 11:29

Find more questions by tags JavaScriptHTML