D
D
De1f2019-06-03 15:56:00
JavaScript
De1f, 2019-06-03 15:56:00

Multiple conditions in onclick?

Good afternoon, please tell me, if in the onclick event there is one more condition in addition to the goal of the metric, how to write them down correctly?
onclick="attrib='Get Cost';yaCounterXXXXX.reachGoal('name'); return true;"
tried so, but the purpose does not fulfill.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Ruslan Ruslanov, 2019-06-03
@dasauser

element.addEventListener('click', function() {
    //code
});

A
Alexey Denisov, 2019-06-03
@DeoZ

Maybe you already have an updated Metrica on the page?
Now the transfer of information about the achievement of the goal is organized by the following code:
ym(XXXXXX, 'reachGoal', 'TARGET_NAME'); return true;
, where XXXXXX is the number of your counter;
TARGET_NAME - target identifier.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question