admin管理员组文章数量:1391989
I have to make a summary of locations with google maps API. On the map there are letters corresponding to the waypoints, I have a separate <div>
with all the route information.
Right now I have it set as an <ul>
, I want to make it an <ol>
with letters. However, since the starting location isn't included in the route information and it has a marker with A on the map my route information needs to start with B.
Is there a way to do this?
I have tried making a list item before the rest with display: none
.
I tried using the start
attribute.
I tried using the value
attribute in bination with a JavaScript array.
<ol id="sortable" class="directions-panel list-container list" type="A">
<li style="display:none;"></li>
</ol>
<ol id="sortable" class="directions-panel list-container list" type="A" start="B"></ol>
<ol id="sortable" class="directions-panel list-container list" type="A">
<li value="B"></li>
</ol>
I have to make a summary of locations with google maps API. On the map there are letters corresponding to the waypoints, I have a separate <div>
with all the route information.
Right now I have it set as an <ul>
, I want to make it an <ol>
with letters. However, since the starting location isn't included in the route information and it has a marker with A on the map my route information needs to start with B.
Is there a way to do this?
I have tried making a list item before the rest with display: none
.
I tried using the start
attribute.
I tried using the value
attribute in bination with a JavaScript array.
<ol id="sortable" class="directions-panel list-container list" type="A">
<li style="display:none;"></li>
</ol>
<ol id="sortable" class="directions-panel list-container list" type="A" start="B"></ol>
<ol id="sortable" class="directions-panel list-container list" type="A">
<li value="B"></li>
</ol>
Share
Improve this question
edited Jun 25, 2019 at 12:06
VLAZ
29.1k9 gold badges63 silver badges84 bronze badges
asked Jun 25, 2019 at 11:36
Patrick de RondePatrick de Ronde
531 silver badge6 bronze badges
2
-
6
Use start
start=2
instead ofstart="B"
– Walk Commented Jun 25, 2019 at 11:39 - this works! thanks! @Walk – Patrick de Ronde Commented Jun 25, 2019 at 11:41
1 Answer
Reset to default 5You were close - the start
attribute accepts a number as the starting position, regardless if the list displays letters or numbers. All you need is start="2"
:
<ol id="sortable" class="directions-panel list-container list" type="A" start="2">
<li>one</li>
<li>two</li>
<li>three</li>
</ol>
本文标签: javascriptcan I make an alphabetical Ordered List starting at B instead of AStack Overflow
版权声明:本文标题:javascript - can I make an alphabetical Ordered List starting at B instead of A - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744642836a2617223.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论