我有以下数据,
[
{ id: 0, Department: "Civil", Value: "40000", Title:"Sustainability", ComID: "45", organisation: { City: "New York", ComID: 45, Country: "USA" } },
{ id: 1, Department: "Energy", Value: "82000", Title: "Wind Energy", ComID: "62", organisation: { City: "Paris" , ComID: 62, Country: "France" } },
{ id: 2, Department: "Medical", Value: "67000", Title: "Neuroscience", ComID: "21", organisation: { City: "Berlin", ComID: 21, Country: "Germany" } },
{ id: 3, Department: "Computer", Value: "100000", Title: "Security", ComID: "67", organisation: { …Run Code Online (Sandbox Code Playgroud) 你好,我有这些 div:
<div id="layoutGroup1">
<h2>UK Map</h2>
<div div style="width: 650px; height: 700px;" id="MapDIV"></div>
<div id="userUpdateDIV"></div>
<div id="BarChartDIV"></div>
<div id="divPack1"></div>
</div>
<div id="layoutGroup2">
<div id="tree"></div>
</div>
<div id="layoutGroup3">
<div id="map"></div>
</div>
Run Code Online (Sandbox Code Playgroud)
我希望在屏幕上显示三个按钮,然后单击隐藏两个 div 并仅显示一个。
button id="userButton" onclick ="showOnClick('layoutGroup1');">ECA </button
Run Code Online (Sandbox Code Playgroud)
button id="userButton" onclick ="showOnClick('layoutGroup1');">ECA </button
Run Code Online (Sandbox Code Playgroud)
上面是我使用的函数,尽管它给了我一个错误,即getElementByIDis null。