Home:ALL Converter>How can I change the value of an input text of an iframe?

How can I change the value of an input text of an iframe?

Ask Time:2020-01-10T18:16:03         Author:jewishmoses

Json Formatter

So basically I have a button and once that button has been clicked it will add an iframe code and it'll load it. I want to change the value of the input type text that has been loaded with the iframe.

I have managed to do this by typing this into the Chrome console:

document.querySelector("...").value = "new text"

but this only works when 'embed' is set from the JavaScript context menu on Chrome console. How can I do it without that?

Image: setting to 'embed' on JavaScript context menu

I can not add any ids to the input etc.

Author:jewishmoses,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/59679658/how-can-i-change-the-value-of-an-input-text-of-an-iframe
yy