How do I pass a parameter to a function?

  • 0
    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

  • 2 Answers
  • 0
    function ASE_onButtonTarget22(this_num) {
    window.ActionEvents.saveaction([ASE_JS.userId, 'target',
    location.href, this_num, '3848']);
    }
    Anonymous

  • 0
    Reply in comments
    Anonymous

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!