Je travaille avec Iframes pour contrôler les éléments de iframe en l'automatisant à partir du fichier html parent. je tentais de cliquer sur le lien défini dans le fichier iframe.html à partir du fichier test.html à l'aide de la fonction clic() javascript lors du chargement test.html:innerDocument.getElementById (<elment ID>) .click(); ne fonctionne pas dans Firefox/chrome, dans IE cela fonctionne
fichier Test.html:
function handleMainOnload(){
alert("main frame loaded");
var innerFrame = document.getElementById("frame1");
alert("hi-1" + innerFrame.ownerDocument.title);
var innerDocument = frame1.document;
alert("hi" + innerDocument.title);
innerDocument.getElementById("input1").value = "Dynamically Inserted Text";
innerDocument.getElementById("a1").click();
}
<body onload="handleMainOnload();">
<iframe id="frame1" src="iframe.html"/>
fichier iframe.html:
<a id="a1" href="http://www.google.co.in"> Google.. click</a>
Cet id = Acor a1 automatiquement obtenir cliqué onload de test.html dans IE mais ne fonctionne pas sur n'importe quel navigateur en dehors de IE. S'il vous plaît aider.
Super ... ça marche bien .. merci :-) – Kamakshi