Home >Backend Development >PHP Tutorial >javascript - value problem. There is SegmentFault

javascript - value problem. There is SegmentFault

WBOY
WBOYOriginal
2016-09-08 08:43:54904browse

javascript - value problem. There is SegmentFault

javascript - value problem. There is SegmentFault

<code>    <ul style="list-style:none;width:100%;padding: 0;margin: 0;">
        {foreach from=$sub_series item=sub}
        <li  class="s{$sub.parent_id}" name="sub_cate_id" id="sub_cate_id" onclick="searchGoods();" value="{$sub.sapval}">{$sub.cat_name}</li>
        {/foreach}
    </ul>
</form></code>

Reply content:

javascript - value problem. There is SegmentFault

javascript - value problem. There is SegmentFault

<code>    <ul style="list-style:none;width:100%;padding: 0;margin: 0;">
        {foreach from=$sub_series item=sub}
        <li  class="s{$sub.parent_id}" name="sub_cate_id" id="sub_cate_id" onclick="searchGoods();" value="{$sub.sapval}">{$sub.cat_name}</li>
        {/foreach}
    </ul>
</form></code>

ID is unique! Dear

How can the id be repeated?

Use class or other attribute nodes

In addition to the duplication of IDs, it seems that li cannot be used to obtain the value like this! value basically gets the value of input

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn