u=161592573,2959487360&fm=58&s=C7D1AC72F5766A31464998460200E0F1

layui获取下拉框选中的值

添加新的窗口
<div class="citymd">
    <ul>
        <li>
            <a onclick="openCityTab('/pc/plugin/pdf-js/web/viewer.html?name=${base}/pc/pdf_report/stateProfile_pdf/AmericaSurveyAnalysis.pdf','美国')">美国</a>
        </li>
    </ul>
</div>
var base = "${base}";
function openCityTab(url, title) {
  top.larryTab.tabAdd({
    title: title,
    href: url
  });
}
<form class="layui-form" action="">
    <div class="layui-form-item layui-col-md3  ">
        <label class="layui-form-label">请选择</label>
        <div class="layui-input-block">
            <select class="form-control input-sm" name="category" lay-filter="category" aria-invalid="false">
                <option value="0">中国</option>
                <option value="1">美国</option>
                <option value="2">德国</option>
                <option value="3">日本</option>
                <option value="4">中美德日</option>
            </select>
        </div>
    </div>
</form>
  layui.use('form', function () {
    var form = layui.form;
    var category = 0;
    var categoryName = '';
    form.on('select(category)', function (data) {
      category = data.value;
      categoryName = data.elem[data.elem.selectedIndex].text;
      form.render('select');
    });
  });

 

如果插件对您有用,请随意打赏。您的支持将鼓励我做的更好!

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦