In phpmailer, I want to use a script tag inside the variable body to do something in the click event. For example, this is the body which I send in the email. I put it in $mail->body='<html>..<script>....'
<html>
<head>
<title></title>
<script>
document.getElementById("btn").onclick=function(){clt()};
function clt(){
console.log("okk");
}
console.log("okk");
</script>
</head>
<script>
document.getElementById("btn").onclick=function() {clt()};
function clt(){
console.log("okk");
}
console.log("okk");
</script>
<body>
<p id="txt">tetet</p><button id="btn" onclick="clt()">click me! </button>
<script>
document.getElementById("btn").onclick=function() {clt()};
function clt(){
console.log("okk");
}
console.log("okk");
</script>
</body>
</html>