任何想法为什么这不起作用.
单击时按是按钮可以使用一次 – 否按钮不起作用
function $(x) {
return document.getElementById(x);
}
var glob = 0;
function new_index() {
glob += 1;
return "d" + glob;
}
function play() {
say("Hello is JS Fun?");
response("No",
function() {
say("Oh dear")
});
response("Yes",
function() {
say("Great:");
});
}
function say(x) {
$("txt").innerHTML += x;
}
function response(Txt, Fun) {
var n = new_index();
var s = "" + Txt + "";
say(s);
var xx = $(n);
// xx.οnclick=Fun;
xx.addEventListener("click", Fun);
}
play();