Let's assume for your example the following structure:
start.html
h1.html (iframe menu)
function alterarInput()...
h2.html (iframe resto)
<input id="input1" />
In any of the iframes
, you can access the parent (start) page with Javascript
, and then any parent element, with%. So in the example I put in the function that is in the iframes
menu, let's access the iframe
of the input
rest like this:
function alterarInput() {
parent.resto.document.getElementById('input1').value= 'novo valor';
}
Note: avoid using iframe
, they are obsolete, and the permissions of some browsers may prevent them from working. If you need to use separate files there are other more modern alternatives.