Latest web development tutorials
×

JavaScript & HTML DOM คู่มืออ้างอิง

ภาพรวม

JavaScript วัตถุ

JavaScript Array วัตถุ JavaScript Boolean วัตถุ JavaScript Date วัตถุ JavaScript Math วัตถุ JavaScript Number วัตถุ JavaScript String วัตถุ JavaScript RegExp วัตถุ JavaScript อสังหาริมทรัพย์ทั่วโลก / ฟังก์ชั่น JavaScript ผู้ประกอบการ

Browser วัตถุ

Window วัตถุ Navigator วัตถุ Screen วัตถุ History วัตถุ Location วัตถุ

DOM วัตถุ

HTML DOM Document วัตถุ HTML DOM วัตถุธาตุ HTML DOM แอตทริบิวต์วัตถุ HTML DOM วัตถุที่จัดกิจกรรม

HTML วัตถุ

<a> <area> <audio> <base> <blockquote> <body> <button> <canvas> <col> <colgroup> <datalist> <del> <details> <dialog> <embed> <fieldset> <form> <iframe> <frameset > <img> <ins> <input> - button <input> - checkbox <input> - color <input> - date <input> - datetime <input> - datetime-local <input> - email <input> - file <input> - hidden <input> - image <input> - month <input> - number <input> - range <input> - password <input> - radio <input> - reset <input> - search <input> - submit <input> - text <input> - time <input> - url <input> - week <keygen> <link> <label> <legend> <li> <map> <menu> <menuItem> <meta> <meter> <object> <ol> <optgroup> <option> <param> <progress> <q> <script> <select> <source> <style> <table> <td> <th> <tr> <textarea> <title> <time> <track> <video>

HTML DOM TR คุณสมบัติ rowIndex

อ้างอิงวัตถุ TR วัตถุ TR

ความหมายและการใช้งาน

rowIndex คุณสมบัติส่งกลับแถว ( แถว ) ตำแหน่ง (ดัชนีแถว) ในแถวในชุดตาราง

ไวยากรณ์

กลับ rowIndex คุณสมบัติ:

trObject.rowIndex

เคล็ดลับ: คุณสมบัติ rowIndexมีค่าเริ่มต้นไม่มี


สนับสนุนเบราว์เซอร์

Internet ExplorerFirefoxOperaGoogle ChromeSafari

เบราว์เซอร์ที่สำคัญทั้งหมดสนับสนุนคุณสมบัติ rowIndex


ตัวอย่าง

ตัวอย่าง

ตัวอย่างต่อไปนี้จะส่งกลับตำแหน่งของแถวในตารางที่:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>本教程(w3big.com)</title>
<script>
function displayResult(x){
    alert("Row index is: " + x.rowIndex);
}
</script>
</head>
<body>

<table border="1">
    <tr onclick="displayResult(this)">
        <td>单击显示行下标</td>
    </tr>
    <tr onclick="displayResult(this)">
    <td>单击显示行下标</td>
    </tr>
    <tr onclick="displayResult(this)">
    <td>单击显示行下标</td>
    </tr>
</table>

</body>
</html>

ลอง»


อ้างอิงวัตถุ TR วัตถุ TR