我想在单击按钮时隐藏文本框,问题是按钮已经被隐藏,在更改该文本框中的文本后将显示该按钮
答案 0 :(得分:0)
我认为这可能对您有用,但是就像其他人说的那样,如果您不发布代码:P
,则很难回答。document.querySelector('#yourinput > location > etc').onkeypress = function() {
//If our text input detects a key press do this function
/*
//Optional*
if (document.querySelector('#yourinput > location > etc').value == "MagikWord"){
document.querySelector('#yourbutton').style.display = "block";
}
else{
document.querySelector('#yourbutton').style.display = "none";
}
//With this additional condition your button wont show up until you type "MagikWord"
*/
document.querySelector('#yourbutton').style.display = "block";
}
document.querySelector('#yourbutton').onclick = function(){
document.querySelector('#yourinput > location > etc').style.display = "none";
}