I am working on a webpage that includes an iframe, and I am trying to simulate a "return key" press when the page loads. I have heard that using the onload event should do the trick, but it doesn't seem to be working for me. I don't have much experience with JavaScript, so I would prefer to not use JQuery and stick to plain Javascript if possible.
Below is the code snippet I have tried, however, it isn't functioning as expected.
onload="alert('done!')";
function () {
alert("trigger.Event('keydown', {keyCode: 13});");
}
<iframe src="https://URL_of_the_Iframe_server.js">