How do I pass a parameter to a function?
-
Good afternoon, please help me solve the problem. Task: some numbers must be sewn into the link in onclick. By clicking on the link, these numbers should be passed to the function, and the function should work. I know JS too little, I can imagine in general terms how it should work, but I can't implement it. There should be onclick, and there is no other way, because this link will be inserted into the article block, where js cannot be inserted.
Help please :)
<a onclick="ASE_onButtonTarget22(цифры отсюда)">Ссылка</a>
<script> function ASE_onButtonTarget22() { window.ActionEvents.saveaction([ASE_JS.userId, 'target', location.href, 'цифры сюда', '3848']); } </script>
JavaScript Ariana O'Neal, Nov 15, 2020 -
function ASE_onButtonTarget22(this_num) {
window.ActionEvents.saveaction([ASE_JS.userId, 'target',
location.href, this_num, '3848']);
}Anonymous -
Reply in commentsAnonymous
2 Answers
Your Answer
To place the code, please use CodePen or similar tool. Thanks you!