logo
  • 教程列表
  • SO官方文檔
  • 每個功能
    • jQuery 的每個功能
    • 基本用途
  1. StackOverflow 文件
  2. jQuery 教程
  3. 每個功能
  4. jQuery 的每個功能

jQuery 的每個功能

Created: November-22, 2018

HTML:

<ul>
  <li>Mango</li>
  <li>Book</li>
</ul>

指令碼:

$( "li" ).each(function( index ) {
  console.log( index + ": " + $( this ).text() );
});

因此,為列表中的每個項記錄一條訊息:

0:芒果

1:預訂

  • 基本用途
  • 每個功能

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 關於本站
  • 免責聲明