Form submit sample(only one field)

how to trigger form submit?

by camel2243

HTML

<form 
  id="login-form" 
  onsubmit="alert('onsubmit'); return false;">
  username: <input type="text" name="username">
</form>