HTML inert 屬性
示例
使用 inert 屬性停用一個部分
<div inert>
<button onclick="alert(42)">
<input type="text">
<a href="https://w3schools.com">W3Schools.com</a>
</div>
自己動手試一試 »
定義和用法
inert
屬性會停用一個元素及其內部的所有元素。
這些元素仍然可見,但它們沒有任何功能:按鈕和連結無法點選,輸入欄位被停用等,並且螢幕閱讀器會忽略它們。
瀏覽器支援
Attribute | |||||
---|---|---|---|---|---|
inert | 102 | 102 | 112 | 15.5 | 88 |
語法
<element inert>