繁体   English   中英

如何加载带有预选类别选项的页面

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM