From df632975ea6cdf7129b6392ffada19c5efd24de9 Mon Sep 17 00:00:00 2001 From: tsymq-live <103803861+tsymq-live@users.noreply.github.com> Date: Sat, 20 May 2023 10:54:23 +0800 Subject: [PATCH] Update form.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复谷歌翻译,翻译成英文后下拉框会多出html标签问题 --- src/modules/form.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/form.js b/src/modules/form.js index 41428288..a589e351 100644 --- a/src/modules/form.js +++ b/src/modules/form.js @@ -519,7 +519,7 @@ layui.define(['lay', 'layer', 'util'], function(exports){ var selectedIndex = select[0].selectedIndex; thatInput = input; // 当前的 select 中的 input 元素 - initValue = $(select[0].options[selectedIndex]).html(); // 重新获得初始选中值 + initValue = $(select[0].options[selectedIndex]).text(); // 重新获得初始选中值 // 如果是第一项,且文本值等于 placeholder,则清空初始值 if(selectedIndex === 0 && initValue === input.attr('placeholder')){