Custom webview automatic click on website ok

how to click on ok button automatically shows on a website when it is open on a custom web viewer

When PageLoaded event is raised, run js query to click on a button.
document.getElementById(‘button’s_id’).click();

Could you please show me the block?
When select one option on a website confirm ok button cant click