Answer the question
In order to leave comments, you need to log in
How to add onclick by button id?
There is a form on the wordpress elementor, you need to add to the button knowing its id the metric function when pressed, if it is possible to implement it in PHP it will be cool
Answer the question
In order to leave comments, you need to log in
It's worded a bit badly, but if I understand correctly, and you need to call PHP through onClick, then it won't work without a Javascript sandwich.
php:
function php_func(){
echo "Stay Safe";
}
function clickMe(){
var result ="<?php php_func(); ?>"
document.write(result);
}
<button onclick="clickMe()"> Click </button>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question