0
我有一個非常簡單的下拉菜單來選擇銀行名稱。 下面是代碼:Firefox和Chrome下拉菜單的輸出不一致
<select id = "bankoption">
<option value="bank1">bank1</option>
<option style = "display:none" value ="bank4">bank4</option>
<option style = "display:none" value ="bank27">bank27</option>
<option style = "display:none" value ="bank22">bank22</option>
<option style = "display:none" value ="bank19">bank19</option>
<option style = "display:none" value ="bank21">bank21</option>
<option style = "display:none" value ="bank15">bank15</option>
<option style = "display:none" value ="bank23">bank23</option>
<option style = "display:none" value ="bank18">bank18</option>
<option style = "display:none" value ="bank26">bank26</option>
<option style = "display:none" value ="bank10">bank10</option>
<option style = "display:none" value ="bank17">bank17</option>
<option style = "display:none" value ="bank20">bank20</option>
<option style = "display:none" value ="bank16">bank16</option>
<option style = "display:none" value ="bank9">bank9</option>
<option style = "display:none" value ="bank11">bank11</option>
<option style = "display:none" value ="bank13">bank13</option>
<option style = "display:none" value ="bank3">bank3</option>
<option style = "display:none" value ="bank7">bank7</option>
<option style = "display:none" value ="bank25">bank25</option>
<option value ="bank5">bank5</option>
<option value ="bank28">bank28</option>
</select>
根據上面的代碼BANK1,BANK5和bank28應在下拉列表,並沒有其他人看到。令人驚訝的是,雖然firefox渲染如預期鉻只顯示bank1選項。
下面是附加的圖像。
爲什麼瀏覽器不同的渲染呢?如果我以錯誤的方式做事,那麼正確的方法是什麼?
但爲什麼瀏覽器之間的這種不一致?這是我們應該向Chrome報告的錯誤嗎? – bhavesh
我不會把它稱爲一個錯誤。所有瀏覽器都以不同的方式呈現網頁(稍微)。這就是爲什麼你在所有不同的瀏覽器中測試的真正好處。 – Jenn