layer在自定义html弹窗只能以字符串的形式吗?
$('#lingqu').bind('click',function (e) {
var div = '\n' +
' 领取数据类型
\n' +
' \n' +
' \n' +
' \n' +
' 领取数据数量
\n' +
' \n' +
' '
layer.open({
title: '领取选择', //头显示名称
type: 1, //Page层类型
skin: 'layui-layer-rim', //加上边框
area: ['400px', '300px'], //宽高
content: div, //弹窗内的html
btn: ['确定'] //按钮,可以给多个,按钮还有种类以及排列方式,可在layer官方文档中找到
,yes: function(index, layero){ //第一个按钮的回调函数
var txtReason = top.$('#receiveNum').val(); //可以获取到id为receiveNum的input框内输入的内容
var sel = top.$("#dataType option:selected").val(); //可以获取到弹出层中id为dataType的select框的选中option的value
var sel = top.$("#dataType option:selected").text(); //可以获取到弹出层中id为dataType的select框的选中option的文本
alert(sel);
}
});
})