我想单击onclick函数时显示其他对象。当我点击那个按钮时,它会隐藏一个对象并显示另外两个对象。我已经将style.visibility设置为可见。但展示两个对象不起作用。显示HTML对象
更新样本:
<input type="submit" id="show" name="show" value="show" onclick="RemoveDoc(); document.getElementById('docname').style.visibility='hidden'; document.getElementById('browse').style.visibility='visible'; return false;" />
//browse input
<input type ="file" name="browse" id="browse">
方法2:
//Using my RemoveDoc() function, I want the button of browse being show out.
function RemoveDoc(Doc)
{
xmlhttp1=new XMLHttpRequest();
xmlhttp1.open("GET","functions/remove.php?Doc="+Doc,true);
xmlhttp1.onreadystatechange=function()
{
if (xmlhttp1.readyState==4 && xmlhttp1.status==200)
{
//when i run debugging, it says that the style of null..
document.getElementById("browse").style.visibility='visible';
}
}
xmlhttp1.send();
return false;
}
</script>
我尝试了两种方法,这也都显示着浏览按钮。 它应该叫出我的浏览对象,因为它是可见的..亲切的建议。
你能发布所有相关的HTML代码,也是你的功能'RemoveDoc'? – 2012-07-13 12:44:26
@Neal我猜他试过了他发布的代码。 – 2012-07-13 12:44:54
@Hans没有完整的代码,我可以看到。 – Neal 2012-07-13 12:45:34