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

javascript - value problem. There is SegmentFault

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-09-08 08:43:54
Original
942 people have browsed it

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>
Copy after login
Copy after login

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>
Copy after login
Copy after login

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

Related labels:
source:php.cn
Statement of this Website
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
Latest Issues
What are JavaScript hook functions?
From 1970-01-01 08:00:00
0
0
0
What is JavaScript garbage collection?
From 1970-01-01 08:00:00
0
0
0
c++ calls javascript
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template