การเรียกใช้งาน Selectors ของ jQuery ในการอ้างถึง element ต่าง ๆ (:last Selector(

ตอบกระทู้

รูปแสดงอารมณ์
:icon_plusone: :like: :plusone: :gfb: :-D :) :( :-o 8O :? 8) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen: :angry: :baa: :biggrin:
รูปแสดงอารมณ์อื่นๆ

BBCode เปิด
[img] เปิด
[url] เปิด
[Smile icon] เปิด

กระทู้แนะนำ
   

มุมมองที่ขยายได้ กระทู้แนะนำ: การเรียกใช้งาน Selectors ของ jQuery ในการอ้างถึง element ต่าง ๆ (:last Selector(

Re: การเรียกใช้งาน Selectors ของ jQuery ในการอ้างถึง element ต่าง ๆ (:last Selector(

โดย gclub24hr » 31/07/2016 1:20 pm

ขอบคุณมากสำหรับความช่วยเหลือของคุณ

Re: การเรียกใช้งาน Selectors ของ jQuery ในการอ้างถึง element ต่าง ๆ (:last Selector(

โดย rangsun6342 » 31/07/2016 1:09 pm

ขอขอบคุณผู้ดูแลระบบ

Re: การเรียกใช้งาน Selectors ของ jQuery ในการอ้างถึง element ต่าง ๆ (:last Selector(

โดย tleonline » 10/06/2015 12:32 pm

กำลังหาข้อมูลเลยครับ ของคุณมากๆ

Re: การเรียกใช้งาน Selectors ของ jQuery ในการอ้างถึง element ต่าง ๆ (:last Selector(

โดย ewin882015 » 07/04/2015 1:06 pm

ขอบคุณมากครับ กำลังหาอยู่เลย

Re: การเรียกใช้งาน Selectors ของ jQuery ในการอ้างถึง element ต่าง ๆ (:last Selector(

โดย tongclub48 » 16/12/2014 1:40 pm

ขอบคุณสำหรับข้อมูลคับ

การเรียกใช้งาน Selectors ของ jQuery ในการอ้างถึง element ต่าง ๆ (:last Selector(

โดย M008 » 08/06/2013 6:57 pm

:last Selector() เป็นการใช้ Selectors กับ :last Selector() คือในการอ้างถึง element ที่ ลำดับของ index ที่ last หรือ ที่อยู่ในลำดับ สุดท้าย
Syntax

โค้ด: เลือกทั้งหมด

jQuery(':last')
ตัวอย่างการใช้งาน

โค้ด: เลือกทั้งหมด

<html>
<head>
<title>ThaiCreate.Com jQuery Tutorials</title>
<script type="text/javascript" src="jquery-1.6.4.js"></script>
<script type="text/javascript">

		$(document).ready(function(){

			$("tr:last").css({backgroundColor: 'yellow', fontWeight: 'bolder'});

		});
</script>
</head>
<body>

  <table>

    <tr><td>First Row</td></tr>
    <tr><td>Middle Row</td></tr>
    <tr><td>Last Row</td></tr>

  </table>

</body>
</html>
ผลลัพธ์
16.jpg
16.jpg (11.19 KiB) Viewed 3384 times
คำอธิบายใต้รูป
จากตัวอย่างเป็นการใช้ Selectors กับ :last Selector() ในการอ้างถึง element เช่น $("tr:last") คือการอ้างถึง element ที่ <tr> อยู่ในลำดับสุดท้าย

ข้างบน