我想單擊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