html - onClick() function can't trigger javascript code -
i have small problem. tried add onclick
function submit button javascript doesn't run. dont't know error :( when put code inside onclick
property alert dialog works fine.
<head> <script type="text/javascript"> fuction login() { alert('hello'); } </script> </head> <body> <form action="javascript:void(0);" method=""> <fieldset class="clearfix"> <p><span class="fontawesome-user"></span><input type="text" value="إسم المستخدم أو الأيميل" name="username" onblur="if(this.value == '') this.value = 'إسم المستخدم أو الأيميل'" onfocus="if(this.value == 'إسم المستخدم أو الأيميل') this.value = ''" required/></p> <!-- js because of ie support; better: placeholder="username" --> <p><span class="fontawesome-lock"></span><input type="password" value="كلمة السر" name="psw" onblur="if(this.value == '') this.value = 'كلمة السر'" onfocus="if(this.value == 'كلمة السر') this.value = ''" required/> </p> <!-- js because of ie support; better: placeholder="password" --> <p><input type="submit" value="login" onclick="login();" /></p> </fieldset> </form> </body>
i see have made simple spelling of "function" above.
please change function login(){...
Comments
Post a Comment