[英]html select tag to apply css
從 html <select>
標簽中選擇一個選項后,我想應用 css 文件。
我嘗試使用這些鏈接指向現有的 css 文件。
<link rel="stylesheet" href="first.css" />
<link rel="stylesheet" href="second.css" />
我如何在<select>
中使用它們?
<select name="choose-an-option">
<option value="first">
<!--use first.css here-->
</option>
<option value="second">
<!--use second.css here-->
</option>
</select>
你可能想看看這個
試試這個:
$("#choose-an-option").change(function() {
$("link").attr("href", this.value + ".css");
)};
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.