function func(event) { event.preventDefault(); var b = document.getElementsByTagName('form')[0].children; addStr(b[0].value, b[1].value); }