I have some buttons with id = "ok_1", "ok_2", "ok_3"…
How to click in all buttons init with "ok_" using javascript?
>Solution :
Use an attribute selector that checks for prefix (^=):
document.querySelectorAll('[id^="ok_"]').forEach(btn => btn.click());