I have a list that is pre-filled depending on the clicks made within the website. The variable value is filled with the data name of the element clicked. Is there a way to email the variable value once a submit button is clicked that works in the background e.g doesn't open an email client.
var operatorPrice = "";
var emergencyStop = "";
$(".estop").click(function() {
emergencyStop = $(this).attr("data-name");
document.getElementById("station").innerHTML = emergencyStop;
operatorPrice = $(this).attr("name");
document.getElementById("station-price").innerHTML = operatorPrice;
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<li>
<span id="station"></span> <span id="station-price" class="qty price">
</span>
</li>