var
tr = document.getElementById(
"Id1"
),
// 取得ID为Id1的tr对象
inps = tr.getElementsByTagName(
'input'
);
// 从tr 对象中获取所有input对象
for
(
var
i = 0, len = inps.length; i < len; i++) {
inps[i].value =
''
;
// 将每一个input的value置为空
}
document.
getElementById(
"t").
getElementsByTagName(
'input')[
0].
value=
'';
输入中文置空的方法
<
el-input
@change="
checkNo(
searchForm.
msel.
mselTotalConsumTimes)"
type =
"text"
onkeypress=
"return event.keyCode>=48
&&
event.keyCode<=57"
size=
"small"
:maxlength="
6"
style=
"width: 120px"
v-model="
searchForm.
msel.
mselTotalConsumTimes"
></
el-input
> 次
</
el-col
>
checkNo(
value){
let
reg =
/
^
[1-9]\d*
$
/;
if (
value) {
if (
value >
999999 ||
new
RegExp(
reg).
test(
value) ==
false) {
setTimeout(()
=> {
this.
searchForm.
msel.
mselTotalConsumTimes =
'';
},
500);
}
}
},