1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
$ie = New-Object -com "InternetExplorer.Application" $ie.Navigate("about:blank") $ie.visible = $true $htmlnew=(' <input id="pinchable" type="button" value="Pinchame y verás" />') $ie.Document.write($htmlnew) $htmlnew=('<script>// Función externa function muestraelmensaje() { alert(''Gracias por pinchar''); } // Asignar la función externa al elemento document.getElementById("pinchable").onclick = muestraelmensaje; </script> ') $ie.Document.write($htmlnew) $ie.Document.getElementById("pinchable").click() |