默认情况下,当我单击按钮时,我希望看到一个文本框,它将允许给出值 [英] I want to see a textbox by default readonly when I click button it will allow to give values
本文介绍了默认情况下,当我单击按钮时,我希望看到一个文本框,它将允许给出值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人请帮助我。
我希望默认情况下看到一个文本框当我单击按钮时它会允许给出值。文本框将出现在同一个地方
我尝试过:
<!DOCTYPE html>
< meta charset =ISO-8859-1>
< title>在这里插入标题
函数setFocusToTextBox(){
文件.getElementById(mytext)。focus();
}
点击编辑
解决方案
您必须在输入控件中使用readonly属性标记控制有一个只读。点击按钮,使用javascript你可以删除这个属性。
只读文本框: - 标记文本框只读 [ ^ ]
删除属性:使用Javascript删除属性 [ ^ ]
谢谢,
Ashwin
Hai
anyone please help me.
I want to see a Textbox by default Readonly when i click button it will allow to give values.The textbox will appear same place
What I have tried:
<!DOCTYPE html>
<meta charset="ISO-8859-1">
<title>Insert title here
function setFocusToTextBox(){
document.getElementById("mytext").focus();
}
CLICK FOR EDIT
解决方案
You will have to use readonly attribute with your input control to mark control has a readonly. On click of a button, using javascript you can remove this attribute.
Readonly Textbox : - Mark textbox readonly[^]
Remove Attribute : Remove Attribute using Javascript[^]
Thanks,
Ashwin
这篇关于默认情况下,当我单击按钮时,我希望看到一个文本框,它将允许给出值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文