I'm developing a website, and I need to trigger 2 events when a text is clicked. A js function, and a google analytics goal tracking code. Here's an 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'm doing on localhost I can not test whether the 2 are working. And I think I'm not, because I changed the call order to the function and did not activate the function, so the code I sent here is not working.
How would it be done to add 2 onclick events with native JavaScript? There is another way to make it easier / right.