javascript - getElementById return null -
i'm new meteor , js it's exciting learn new stuff , play it.
i'm doing little app (and other things :p ):
in client.html file:
<template name="input"> <form action={{submit}}> <p> name : <input type="text" id="bibiname"> message : <input type="text" id="bibimessage"> <input type="submit" value="toto"> </p> </form> </template>
in client.js file:
template.input.submit = function () { alert(document.getelementbyid("bibiname" )); }
result: pop window wit "null".
what doing wrong ?
is because execution of "submit function" in client.js file occurs before creation of "bibiname input" in client.html ?
thx tips
if want add listener when form submitted, use template.mytemplate.events instead.
Comments
Post a Comment