Latest web development tutorials

HTML DOM 그럴 rowIndex에 등록

그럴 개체 참조 그럴 객체

정의 및 사용

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>

»시도


그럴 개체 참조 그럴 객체