Home > Article > Web Front-end > javascript method to get the value of the element in the page in iframe_javascript skills
IE method:
document.frames['myFrame'].document.getElementById('test').value;
Firefox method:
document.getElementById('myFrame').contentWindow.document.getElementById('test').value;
IE, Firefox method:
var tmp = '';
if(document.frames){
tmp = 'Brother ie said:';
tmp = document.frames['myFrame'].document.getElementById('test').value;
}else{
tmp = document.getElementById('myFrame').contentWindow.document.getElementById('test').value;
}
alert(tmp);
}