![](/img/trans.png)
[英]How to change URL based on option selected so that the new url will go to page with that option pre-selected?
[英]How to load page with category option pre-selected
我希望能夠通過預先選擇的類別選項發送指向此 Web 應用程序的鏈接。 是否可以將其包含在 URL 中,或者在鏈接某人時僅預選一個/多個選項?
請注意:在這種情況下添加“已檢查”屬性將不起作用,它會顯示復選框被選中,但是當您加載頁面時,該類別的產品不可見。
<div class="filterTitle" style="padding-left: 5px">Choose subject(s)</div>
<div class="filterctn">
<div class="optionctn">
<input type="checkbox" name="subject" value="accounting" id="accounting">
<label class="filterlabel" for="accounting">Accounting</label>
</div>
</div>
添加checked
屬性:
<input type="checkbox" name="subject" value="agriculture" id="agriculture" checked>
您必須以編程方式調用該方法來加載該類別中的產品。 如果您無權訪問該方法,則可以在加載 DOM 后在特定復選框上觸發單擊事件。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.