利用bootstrap实现简单的弹窗

首先引入bootstrap的js库和jquery库

例如:

写js方法:

例如:
 

function chstatConfirm(flag, params) {
		if ($("#myConfirm").length > 0) {
			$("#myConfirm").remove();
		}
		var html = "";
		$("body").append(html);


		$("#myConfirm").modal("show");


		$("#confirmOk").on("click", function() {
			$("#myConfirm").modal("hide");
			add(flag, params); // 执行函数
		});
	}
		function add(a,b){
			alert("bootstrap弹窗");
		}

出自:https://www.runoob.com/bootstrap/bootstrap-popover-plugin.html

你可能感兴趣的:(bootstrap,bootstrap)