level 1
输入要显示“0"的length:
<input type="text" id="num1" />
<br />
显示:
<input type="text" id="num2" />
<br />
<input type="button" value="确定" onclick="test()" />
<script>
const oIdNum1 = document.getElementById('num1');
const oIdNum2 = document.getElementById('num2');
function test() {
const num = oIdNum1.value;
oIdNum2.value = num > 0 ? '0'.repeat(num) : '';
}
</script>
2022年05月18日 00点05分