Ou seja, método:
Document.Frames ['MyFrame'].
Método Firefox:
Document.getElementById ('MyFrame').
Ou seja, Método Firefox:
Copie o código do código da seguinte forma:
function getValue () {
var tmp = '';
if (document.frames) {
Tmp += 'ou seja, disse:';
tmp += document.frames ['myFrame'].
} Outro {
tmp = document.getElementById ('MyFrame').
}
alerta (TMP);
}
Exemplo Código:
O código na página A.HTML
Copie o código do código da seguinte forma:
<html>
<head>
<meta http-equiv = "content-type" content = "text/html; charset = utf-8">
<Título>
JavaScript Obtenha o teste de valor do elemento na página no iframe
</Title>
</head>
<Body>
<iframe id = "myframe" src = 'b.html'> </frame>
<input type = "button" id = "btn" onclick = "getValue ()" value = "test">
<script type = "text/javascript">
function getValue () {
var tmp = '';
if (document.frames) {
Tmp += 'ou seja, disse:';
tmp += document.frames ['myFrame'].
} Outro {
tmp = document.getElementById ('MyFrame').
}
alerta (TMP);
}
</script>
</body>
</html>
Código na página B.HTML
Copie o código do código da seguinte forma:
<html>
<head>
<meta http-equiv = "content-type" content = "text/html; charset = utf-8">
<Título>
Eu sou uma página no iframe
</Title>
</head>
<Body>
<input type = 'text' id = "test" value = 'Bem -vindo à visita: justflyhigh.com'>
</body>
</html>