如何把一个html文本框控件隐藏

2025-04-13 01:57:34
推荐回答(1个)
回答(1):

可以用js实现:这是以前写的里面的一小部分,,关键是指定html控件的disabled设置成false为不显示,true为显示;

function ChangeMessageOption() {

UserInput1.disabled = true;
UserInput1.style.display = 'none';
UserInput2.style.display = 'inline';
UserInput2.style.visibility = 'visible';
UserInput2.disabled = false;
UserInput2.focus();
CurrentInput = 0;
}