2013-03-29 156 views
0

我想隱藏一個DIV元素,其中包含一堆其他子元素在頁面加載,但它似乎沒有工作正常。
這個頁面是一個彈出窗口,使用window.open打開,我附加了一些我自己的自定義信息。
這個DIV是默認從服務器來的問題,我無法控制它,只有可能的方式是通過JavaScript。
我到目前爲止有:
在頁面加載隱藏DIV

require(["dojo/ready", "dojo/query"], function(ready, query) { 
     ready(function(){ 
      console.log("This statement is being logged fine....."); 
      hideMyForm();     
     }); 
    }); 


function hideMyForm() 
{ 
var elem = document.getElementById('divInQuestion'); 
elem.display = 'none'; 
} 

回答

4

使用elem.style.display = 'none';

4

使用此:

elem.style.display = 'none'; 
0

你爲什麼不走的jQuery? 包含jQuery,然後使用 $('#divInQuestion')。hide();