1
I’m developing a website, and I need to trigger two events when a text is clicked. A js function, and a google Analytics goal tracking code. Following example
function shownumber() {
document.getElementById("number").innerHTML = "<small>(62)</small> 9999-9999";
}
<p class="fixed__box__number" id="number">
<small>(62)</small> 9999-99...
<span onclick="shownumber();ga('send', 'event', 'Telefone', 'Clicar');">ver telefone</span>
</p>
As I am doing on the localhost I cannot test whether the two are working. And I don’t think I am, because I changed the order of the call to the function and didn’t activate the function, so the code I sent here isn’t working.
How would you add 2 events to onclick with native Javascript? Is there another way to make this easier/right.
Brother, I am very beginner in javascript, and I didn’t get much of this code. There is some more explanatory solution or with my problem applied, in fact?
– haRdy