当前位置: 首页 > 面试题库 >

Why does this simple JSFiddle not work?

柴昆杰
2023-03-14
问题内容

There is some code I wanted to put into JSFiddle. It didn’t work. Narrowing it
down I can’t even get this simplest of code to work:

JSFiddle

function displaymessage() {
  alert("Hello World!");
}



<form>
  <input type="button" value="Click me!" onclick="displaymessage()" />
</form>

<p>By pressing the button above, a function will be called. The function will alert a message.</p>

The alert box doesn’t show up in the JSFiddle.


问题答案:

http://jsfiddle.net/praveen_prasad/XNJxT/14/

Js fiddle so something like this to whatever you write

window.addEvent('load',function(){

//Your code


});

enter image description here



 类似资料:

相关阅读

相关文章

相关问答