UNPKG

hae-uitest

Version:

A UI Test Framework for Huawei HAE

37 lines (32 loc) 912 B
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>sendKeys</title> <script type="text/javascript"> window.onload = function() { var form = document.getElementById('form'); var bt = document.getElementById('bt'); var text = document.getElementById('text'); form.onkeypress = function() { if(event.ctrlKey && (event.which == 13 || event.which == 10)) { bt.click(); } } bt.onclick = function() { alert(text.value); } } </script> </head> <body> <form id="form" action="" method="get"> <p> <textarea name="text" cols="50" rows="10" id="text"></textarea> </p> <p> <input type="button" name="bt" id="bt" value="Ctrl + Enter" /> </p> </form> </body> </html>