I just write the following code to test if the juqery code of key ENTER function simulation works:
<html>
<meta http-equiv=Content-Type content="text/html;charset=utf-8">
<script type="text/javascript" src="jquery-3.1.1.min.js"></script>
<script type="text/javascript">
function Test()
{
var e = jQuery.Event("keydown");
e.keyCode = 13;
$("#test_id").trigger(e);
}
</script>
<body>
<div>
<form method="get" id="form" action="http://www.twitter.com">
<input type="text" value="" name="test_id" id="test_id" />
<input type="text" value="" name="test_id1" id="test_id1" />
<button type="submit">go</button>
</form>
<a href="javascript:Test()" id="btn_nfc" ><font size="10">Test</font></a>
</div>
</body>
</html>
if the code works correctly, then it will redirect to twitter.com, but actually when I click the button "Test", nothing happened, is there anything wrong in the code?