저는 부트 스트랩이 새롭고 메시지 확인을위한 코드를 작성했습니다.확인 메시지에 부트 스트랩 사용 onclick()
다음 코드를 사용하여 onclick()
을 어떻게 넣을 수 있습니까? bootbox의
$("#myModal").on("show", function() { // wire up the OK button to dismiss the modal when shown
$("#myModal a.btn").on("click", function(e) {
console.log("button pressed"); // just as an example...
$("#myModal").modal('hide'); // dismiss the dialog
});
});
$("#myModal").on("hide", function() { // remove the event listeners when the dialog is dismissed
$("#myModal a.btn").off("click");
});
$("#myModal").on("hidden", function() { // remove the actual elements from the DOM when fully hidden
$("#myModal").remove();
});
$("#myModal").modal({ // wire up the actual modal functionality and show the dialog
"backdrop" : "static",
"keyboard" : true,
"show" : true // ensure the modal is shown immediately
});
는 HTML : onclick을
() 입력 :
<input type='submit' name='actualiza_noticia' class='button' onClick="" value='Atualizar notícia'>
대신 이미지 –
당신이 그것을가 표시된 후에, 일단 DOM에서 모달을 제거 하시겠습니까의 코드에서 HTML 코드를 추가 참조하십시오? 즉, 다시 표시 할 수 없으므로 대개 숨기기 만하면됩니다. –
닫기 단추에 대한 html에는'data-dismiss = "modal"'이 있으므로 닫기 단추에 이벤트 리스너가 필요 없습니다. –