How to: Javascript variable in mailto: tag

Is this allowed?

If I have a JS function that receives a variable string called “data” - can I reference it within a mailto: tag?


    function sayHello(data) {
        //alert(" + data+ ");
        return data;
    }

And then something like this (I’m not sure what the syntax should look like):


<a href="mailto:[email protected]*?body=" + data + "*">