layer.open获取弹出层的input框的值

layer.open获取弹出层的input框的值

	js.layer.open({
		type:1,
		title:'填写关闭原因',
		area:['500px','350px'],
		content:'<div id="mydiv"  style="margin-left:35px;margin-top:25px;"><textarea id="Context" style="width:430px;height:210px;resize:none;border-radius:6px;" ></textarea></div>',
		btn:['完成','取消'],
		btn1:function (index,layero){
			//获取弹出层中的dom元素!!
			var closeContext=top.$('#Context').val();
			alert(closeContext);

layer.open获取弹出层的input框的值

top.$(’#Context’).val();就行了。获取弹出层中的内容时,一定要加top,不然一直取不到值。。。。