function - Why isn't this onclick JavaScript call working? -


html

<div id="test"></div> <input type="button" value="go" onclick="test()" /> 

javascript

function test() {     alert("test!"); } 

fiddle

http://jsfiddle.net/mvbrs/11/

please @ one, jsfiddle code frames separation:

inline event handler not working in jsfiddle

of course, if running same code embedded on plain html works normally, having alerted popup appearing.

<!doctype html>   <html>     <head>       <script>         function test() {           alert("test!");         }       </script>      </head>      <body>        <div id="test"></div>        <input type="button" value="go" onclick="test()" />      </body>   </html> 

Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -