<button class='cp_but' onclick='decide(); return false;'>Item</button>
function decide() {
var buttons = "<button class='cp_but' onclick='addItem()'>Add</button>" +
"<button class='cp_but' onclick='done();'>Done</button>";
document.getElementById("but_cont").innerHTML = buttons;
}
function done() {
document.getElementById("but_cont").setAttribute("style", "display:none;");
}
버튼이 "항목"버튼을 처음 클릭 할 때만 추가되는 이유는 무엇입니까?innerHTML이 첫 번째 클릭에서만 작동하는 이유
당신이 http://jsfiddle.net에 대한 데모를 제공 할 수 완료 기능이 하나를 시도? – undefined
알았어, 내가 했어, http://jsfiddle.net/mZGS7/, 너 뭐야? 어떻게해야합니까? – undefined
아마도 문제는 done()에서 "btn_cont"를 숨기고 있지만 데모 또는 더 많은 코드/html이 없기 때문에 결정()에서 표시하지 말아야한다는 것입니다. – Dampsquid