Tlačidlá formulára v JavaScripte

Už viete, že formulár sa odosiela stlačením tlačidla. Tu však existujú nuansy. Tlačidlo musí mať atribút type s hodnotou submit:

public/form.html<form>
  <input name="test1">
  <input name="test2">
  <input type="submit">
</form>

Formulár bude odosielať aj tag button s atribútom type s hodnotou submit:

public/form.html<form>
  <input name="test1">
  <input name="test2">
  <button type="submit">btn</button>
</form>

Formulár bude tiež odoslaný, ak v ktoromkoľvek vstupe nastavíte focus a stlačíte Enter.

Tlačidlo s atribútom type s hodnotou button sa používa ako prvok stránky a nebude odosielať formulár:

public/form.html<form>
  <input name="test1">
  <input name="test2">
  <input type="button">
</form>

Podobne bude fungovať tag button:

public/form.html<form>
  <input name="test1">
  <input name="test2">
  <button>btn</button>
</form>

Tlačidlo s atribútom type s hodnotou reset vyčistí vyplnený formulár:

public/form.html<form>
  <input name="test1">
  <input name="test2">
  <input type="reset">
  <input type="submit">
</form>
Задание 1

Opravte nasledujúci kód tak, aby tlačidlo odoslalo formulár na server:

html<form>
  <input name="name">
  <input name="surn">
  <button>send</button>
</form>