**单选按钮与文本值的获取
<tr>
<td class="laytd" rowspan="3" colspan="7" >审核结果与意见</td>
<td colspan="21">
<input type="radio" value="1" name="audit" title="通过" lay-skin="primary" checked>
<input type="radio" name="audit" value="0" title="不通过" lay-skin="primary">
</td>
</tr>
<tr>
<td colspan="21">
<textarea id="opinion" class="layui-textarea" style="min-height: 1.2rem"></textarea>
</td>
</tr>
对于此单选按钮,在layui,js文件中要想获取其内容 最方便好用的jq方法
(1) 引入: $ = layui.jquery;
(2) 获取: var result = $('input[name="audit"]:checked').val();
var opinion = $("#opinion").val();
备注:一定要引入$,不然不会生效
|