Hey. It was the task to write a script, when you click on the button it will be easy to hide.
Here is the button:
<button name="OK" onclick="my_onclick()" id="button_2" >OK</button>
Here is the function:
function my_onclick() { var element = document.getElementById('button_2'); element.style.display = "none"; }
C javascript encountered 1 time. The function works, but I understand that it is, let's say, not universal and works only with button_2. How should I correctly set the function parameter getElementById('')
to work for all buttons with different IDs? Thank!