title: Passing variable to mailto subject
body: <p>so I'm trying to pass the value of "x" here which will generate the random value.</p>
  
  <pre><code>&lt;script&gt;
  
    var result = Math.random().toString(36).substring(2,5);
    window.onload = function() {
       document.getElementById("x").innerHTML=result;
    } 
  
  &lt;/script&gt;
  </code></pre>
  
  <p>I want to pass the value to my html code, in the mailto subject. so when people click the link, it will automatically open the default mail and send the email to info@legianbeachbali.com with the subject "Special Promotion + (random code)"</p>
  
  <pre><code>&lt;p style="color: #5b5b5b; text-align: left; id: x;"&gt;
  &lt;a title="Book Now" href="mailto:info@legianbeachbali.com?subject=Special%20Promotion%20"+x&gt;Book Directly with Us&lt;/a&gt;&lt;/p&gt;
  </code></pre>
  
  <p>I tried to call the value on id and put "x" in the subject but as I expected, it doesn't work. could you guys please help me? I need to know how to show the value in the subject email. </p>
  
  <p>Thanks in advance.</p>