Jump to content

Why is not this function working on HTML5?


Recommended Posts

<script>function myfunction30(qual){ golbal qual; if if(document.getElementById('nota30').checked) { qual++;}}var qualy=myfunction1(qual)+myfunction2(qual)+myfunction3(qual)+myfunction4(qual)+myfunction5(qual)+myfunction6(qual)+myfunction7(qual)+myfunction8(qual)+myfunction9(qual)+myfunction10(qual)+myfunction11(qual)+myfunction12(qual)+myfunction13(qual)+myfunction14(qual)+myfunction15(qual)+myfunction6(qual)+myfunction17(qual)+myfunction18(qual)+myfunction19(qual)+myfunction20(qual)+myfunction21(qual)+myfunction22(qual)+myfunction23(qual)+myfunction24(qual)+myfunction25(qual)+myfunction26+myfunction27+function28+funtion29+function30<button onclick="myfun()">Submit</button>;function myfun(){ window.alert("Your qualification is: "+qualy+"of 30");</script>

Link to post
Share on other sites

Javascript doesn't have a keyword called "golbal". It doesn't have a "global" keyword, either. And did you really define 30 different functions? Why not a single function that just takes parameters to tell it what to do?You doubled up your if statement, your giant string of function calls has some incorrect calls and some misspelled function names, you have a random peice of HTML code after that, you're missing brackets, and you're trying to pass a global variable to a function and still use the global version.You should use your browser's developer console. It will show you error messages like that.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...