S
S
Sergey2021-01-06 12:24:49
JavaScript
Sergey, 2021-01-06 12:24:49

Rewrite onclick function?

Tell me there is an ancient code

<div id="jq_next_link_container" onclick="jq_QuizNextOn()"><div class="jq_back_button" id="jq_quiz_task_link_container"><a class="btn btn-primary" href="javascript: void(0)" title="NEXT">NEXT</a></div></div>

how can i cancel onclick="jq_QuizNextOn()". I need to cancel this click, fulfill some condition, and then apply the same click again onclick="jq_QuizNextOn()".

PS on click, if media is found on the page, then stop them all. and apply onclick="jq_QuizNextOn()". In chrome, everything works fine when you click on the button, the audio stops, but in mosie=le the audio continues to play.(

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir, 2021-01-06
@sergeiy_permyakov

<script>

function myEvent() { console.log('My Event!'); jq_QuizNextOn(); }

</script>

<div id="jq_next_link_container" onclick="myEvent()"><div class="jq_back_button" id="jq_quiz_task_link_container"><a class="btn btn-primary" href="javascript: void(0)" title="NEXT">NEXT</a></div></div>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question