Sont les suivants:
#cs ----------------------------------------------------------------------------
AutoIt Version: 3.3.14.2
Author: myName
Script Function:
Template AutoIt script.
#ce ----------------------------------------------------------------------------
; Script Start - Add your code below here
#include <IE.au3>
;Visible METHOD 1: Using _IEAction to focus on input, enter "test" using _IEFormElementSetValue and then _IEAction blur to simulate loss of focus to trigger the "onblur" event
$oIE = _IECreate(@ScriptDir & "/example.html")
$oIE_Form = _IEGetObjByName($oIE, "form")
$oIE_Input = _IEFormElementGetObjByName($oIE_Form, "fname")
_IEAction($oIE_Input, "focus")
_IEFormElementSetValue($oIE_Input, "test")
_IEAction($oIE_Input, "blur")
ConsoleWrite("Visible mode result 1: "&_IEFormElementGetValue($oIE_Input)&@CRLF)
_IEQuit($oIE)
Sleep(500)
;Visible METHOD 2: Using _IEAction to focus on input, enter "test" using ControlSend and then _IEAction blur to simulate loss of focus to trigger the "onblur" event
$oIE = _IECreate(@ScriptDir & "/example.html")
$oIE_Form = _IEGetObjByName($oIE, "form")
$oIE_Input = _IEFormElementGetObjByName($oIE_Form, "fname")
_IEAction($oIE_Input, "focus")
$hIE = _IEPropertyGet($oIE, "hwnd")
ControlSend($hIE, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "test")
_IEAction($oIE_Input, "blur")
ConsoleWrite("Visible mode result 2: "&_IEFormElementGetValue($oIE_Input)&@CRLF)
_IEQuit($oIE)
Sleep(500)
;Visible METHOD 3: Using _IEAction to focus on input, enter "test" using _IEFormElementSetValue and then ControlSend {TAB} to simulate loss of focus to trigger the "onblur" event
$oIE = _IECreate(@ScriptDir & "/example.html")
$oIE_Form = _IEGetObjByName($oIE, "form")
$oIE_Input = _IEFormElementGetObjByName($oIE_Form, "fname")
_IEAction($oIE_Input, "focus")
_IEFormElementSetValue($oIE_Input, "test")
$hIE = _IEPropertyGet($oIE, "hwnd")
ControlSend($hIE, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "{TAB}")
ConsoleWrite("Visible mode result 3: "&_IEFormElementGetValue($oIE_Input)&@CRLF)
_IEQuit($oIE)
Sleep(500)
;Hidden METHOD 1: Using _IEAction to focus on input, enter "test" using _IEFormElementSetValue and then _IEAction blur to simulate loss of focus to trigger the "onblur" event
$oIE = _IECreate(@ScriptDir & "/example.html", 0, 0, 1, 0)
$oIE_Form = _IEGetObjByName($oIE, "form")
$oIE_Input = _IEFormElementGetObjByName($oIE_Form, "fname")
_IEAction($oIE_Input, "focus")
_IEFormElementSetValue($oIE_Input, "test")
_IEAction($oIE_Input, "blur")
ConsoleWrite("Hidden mode result 1: "&_IEFormElementGetValue($oIE_Input)&@CRLF)
_IEQuit($oIE)
Sleep(500)
;Hidden METHOD 2: Using _IEAction to focus on input, enter "test" using ControlSend and then _IEAction blur to simulate loss of focus to trigger the "onblur" event
$oIE = _IECreate(@ScriptDir & "/example.html", 0, 0, 1, 0)
$oIE_Form = _IEGetObjByName($oIE, "form")
$oIE_Input = _IEFormElementGetObjByName($oIE_Form, "fname")
_IEAction($oIE_Input, "focus")
$hIE = _IEPropertyGet($oIE, "hwnd")
ControlSend($hIE, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "test")
_IEAction($oIE_Input, "blur")
ConsoleWrite("Hidden mode result 2: "&_IEFormElementGetValue($oIE_Input)&@CRLF)
_IEQuit($oIE)
Sleep(500)
;Hidden METHOD 3: Using _IEAction to focus on input, enter "test" using _IEFormElementSetValue and then ControlSend {TAB} to simulate loss of focus to trigger the "onblur" event
$oIE = _IECreate(@ScriptDir & "/example.html", 0, 0, 1, 0)
$oIE_Form = _IEGetObjByName($oIE, "form")
$oIE_Input = _IEFormElementGetObjByName($oIE_Form, "fname")
_IEAction($oIE_Input, "focus")
_IEFormElementSetValue($oIE_Input, "test")
$hIE = _IEPropertyGet($oIE, "hwnd")
ControlSend($hIE, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "{TAB}")
ConsoleWrite("Hidden mode result 3: "&_IEFormElementGetValue($oIE_Input)&@CRLF)
_IEQuit($oIE)
AutoIt Version: 3.3.14.2
Author: myName
Script Function:
Template AutoIt script.
#ce ----------------------------------------------------------------------------
; Script Start - Add your code below here
#include <IE.au3>
;Visible METHOD 1: Using _IEAction to focus on input, enter "test" using _IEFormElementSetValue and then _IEAction blur to simulate loss of focus to trigger the "onblur" event
$oIE = _IECreate(@ScriptDir & "/example.html")
$oIE_Form = _IEGetObjByName($oIE, "form")
$oIE_Input = _IEFormElementGetObjByName($oIE_Form, "fname")
_IEAction($oIE_Input, "focus")
_IEFormElementSetValue($oIE_Input, "test")
_IEAction($oIE_Input, "blur")
ConsoleWrite("Visible mode result 1: "&_IEFormElementGetValue($oIE_Input)&@CRLF)
_IEQuit($oIE)
Sleep(500)
;Visible METHOD 2: Using _IEAction to focus on input, enter "test" using ControlSend and then _IEAction blur to simulate loss of focus to trigger the "onblur" event
$oIE = _IECreate(@ScriptDir & "/example.html")
$oIE_Form = _IEGetObjByName($oIE, "form")
$oIE_Input = _IEFormElementGetObjByName($oIE_Form, "fname")
_IEAction($oIE_Input, "focus")
$hIE = _IEPropertyGet($oIE, "hwnd")
ControlSend($hIE, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "test")
_IEAction($oIE_Input, "blur")
ConsoleWrite("Visible mode result 2: "&_IEFormElementGetValue($oIE_Input)&@CRLF)
_IEQuit($oIE)
Sleep(500)
;Visible METHOD 3: Using _IEAction to focus on input, enter "test" using _IEFormElementSetValue and then ControlSend {TAB} to simulate loss of focus to trigger the "onblur" event
$oIE = _IECreate(@ScriptDir & "/example.html")
$oIE_Form = _IEGetObjByName($oIE, "form")
$oIE_Input = _IEFormElementGetObjByName($oIE_Form, "fname")
_IEAction($oIE_Input, "focus")
_IEFormElementSetValue($oIE_Input, "test")
$hIE = _IEPropertyGet($oIE, "hwnd")
ControlSend($hIE, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "{TAB}")
ConsoleWrite("Visible mode result 3: "&_IEFormElementGetValue($oIE_Input)&@CRLF)
_IEQuit($oIE)
Sleep(500)
;Hidden METHOD 1: Using _IEAction to focus on input, enter "test" using _IEFormElementSetValue and then _IEAction blur to simulate loss of focus to trigger the "onblur" event
$oIE = _IECreate(@ScriptDir & "/example.html", 0, 0, 1, 0)
$oIE_Form = _IEGetObjByName($oIE, "form")
$oIE_Input = _IEFormElementGetObjByName($oIE_Form, "fname")
_IEAction($oIE_Input, "focus")
_IEFormElementSetValue($oIE_Input, "test")
_IEAction($oIE_Input, "blur")
ConsoleWrite("Hidden mode result 1: "&_IEFormElementGetValue($oIE_Input)&@CRLF)
_IEQuit($oIE)
Sleep(500)
;Hidden METHOD 2: Using _IEAction to focus on input, enter "test" using ControlSend and then _IEAction blur to simulate loss of focus to trigger the "onblur" event
$oIE = _IECreate(@ScriptDir & "/example.html", 0, 0, 1, 0)
$oIE_Form = _IEGetObjByName($oIE, "form")
$oIE_Input = _IEFormElementGetObjByName($oIE_Form, "fname")
_IEAction($oIE_Input, "focus")
$hIE = _IEPropertyGet($oIE, "hwnd")
ControlSend($hIE, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "test")
_IEAction($oIE_Input, "blur")
ConsoleWrite("Hidden mode result 2: "&_IEFormElementGetValue($oIE_Input)&@CRLF)
_IEQuit($oIE)
Sleep(500)
;Hidden METHOD 3: Using _IEAction to focus on input, enter "test" using _IEFormElementSetValue and then ControlSend {TAB} to simulate loss of focus to trigger the "onblur" event
$oIE = _IECreate(@ScriptDir & "/example.html", 0, 0, 1, 0)
$oIE_Form = _IEGetObjByName($oIE, "form")
$oIE_Input = _IEFormElementGetObjByName($oIE_Form, "fname")
_IEAction($oIE_Input, "focus")
_IEFormElementSetValue($oIE_Input, "test")
$hIE = _IEPropertyGet($oIE, "hwnd")
ControlSend($hIE, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "{TAB}")
ConsoleWrite("Hidden mode result 3: "&_IEFormElementGetValue($oIE_Input)&@CRLF)
_IEQuit($oIE)
<!DOCTYPE html>
<html>
<body>
<p>Click the button to trigger a function that will output "Hello World" in a p element with id="demo".</p>
<button onclick="myFunction()">Click me</button>
<p id="demo"></p>
<script>
function myFunction() {
document.getElementById("demo").innerHTML = "Hello World";
}
</script>
</body>
</html>
<html>
<body>
<p>Click the button to trigger a function that will output "Hello World" in a p element with id="demo".</p>
<button onclick="myFunction()">Click me</button>
<p id="demo"></p>
<script>
function myFunction() {
document.getElementById("demo").innerHTML = "Hello World";
}
</script>
</body>
</html>
Merci d'avance.