Wednesday, 15 February 2012

Javascript will not execute -


Why would this work for example, but when I try on my webserver? Using the Vamp How it should be:

     

You should wait for the DOM to be ready, so change your code as :

  & lt; Script & gt; Document.addEventListener ('DOMContentLoaded', function () {var textInput = document.getElementById ('text'), submitButton = document.getElementById ('submit'); function checkTextValue () {if (textInput.value! == ' ') {SubmitButton.style.display =' block ';} Other {submitButton.style.display =' none ';}}}); & Lt; / Script & gt;    

No comments:

Post a Comment