在html頁面我有一個div-reportControlPanel
如下。我已經包含另一個div-reportControlPanel1
與不同的id相同。DIV內容隱藏/顯示基於URL
<div id="reportControlPanel" class="pentaho-rounded-panel-bottom-lr pentaho-shadow">
<div id="promptPanel" class="pentaho-rounded-panel-bottom-lr"></div>
</div>
<div id="reportControlPanel1" class="pentaho-rounded-panel-bottom-lr pentaho-shadow">
<div id="promptPanel" class="pentaho-rounded-panel-bottom-lr"></div>
</div>
我在這裏顯示/隱藏url
上午觸發基於div's
。
if(prptName == "css.prpt")
{
alert("if");
document.getElementById("reportControlPanel").style.display = 'none';
document.getElementById("reportControlPanel1").style.display = 'block';
}
但使用同一子Div- promptPanel下的兩個不同div
我的內容不正確加載的上午。 promptPanel
是pentaho system
使用div
。我正在嘗試另一個div
修改我的prpt
的一些css
。
感謝。
的ID,就是要在頁面上獨一無二的。只有一個元素應該具有'promptPanel'的標識。要使用共享屬性來定位多個元素,您可以使用'class',例如'pentaho-rounded-panel-bottom-lr'。 –
你可以使用jQuery嗎?您可以稍後添加ID,如:$('。pentaho-rounded-panel-bottom-lr> div')。attr('id','promptPanel');'取決於實際加載的DIV(取決於url) – LordNeo
id屬性爲HTML元素指定一個唯一的id(該值在HTML文檔中必須是唯一的)。 – Shrabanee