使用JavaScript刷新地图复选框,该复选框没有ID

时间:2018-10-06 14:26:36

标签: javascript checkbox

我发现有关使用javascript选中复选框的示例均引用了ID。我需要选中下面列出的复选框。

<input data-marker-category="1" value="1" type="checkbox">

使用ID = $("#_1").prop("checked", true);

的示例

下面列出的完整代码

<div class="wpgmp_tab_item" data-container="wpgmp-category-tab-item"><input data-marker-category="1" value="1" type="checkbox"><a href="javascript:void(0);" class="wpgmp_cat_title accordion accordion-close">Access Points<span class="arrow"></span></a></div>

0 个答案:

没有答案