rob*_*bot 8 jquery jquery-selectors
我正在尝试在此有序列表中的第一个li中选择第一个文本节点...
<ol id="authors">
<li id="CD007786-cr-0002">Robert S Phillips<sup>1,*</sup>, </li>
<li id="CD007786-cr-0003">Shireen Gopaul<sup>2</sup>, </li><li id="CD007786-cr-0004">Faith Gibson<sup>3</sup>, </li>
Run Code Online (Sandbox Code Playgroud)
到目前为止,我尝试过:
jQuery("ol#authors li:first-child").text()
Run Code Online (Sandbox Code Playgroud)
但这回归:
Robert S Phillips1,*,
Run Code Online (Sandbox Code Playgroud)
我想要得到的只是:
Robert S Phillips
Run Code Online (Sandbox Code Playgroud)
use*_*654 21
尝试
alert( jQuery("#authors li:first-child").contents().get(0).nodeValue );
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
6808 次 |
最近记录: |