单项选择题

html 页面上有一个 id 值为 b1 的按钮,现需要使用 JavaScript 代码为其定义单击事件:单击该按钮后,弹出“Hello”。下列选项中,错误的是()

A.document.getElementById("b1").onclick =function (){alert("hello");};
B.document.getElementById("b1").onclick =new Function("alert(’hello’);");
C.document.getElementById("b1").onclick =new function (){alert("hello");};
D.document.getElementById("b1").onclick =clickFunc;function clickFunc(){alert("Hello");}