Tuesday, December 18, 2012

tabIndex

Properti HTMLAreaElement.tabIndex menetapkan atau mengembalikan atribut TABINDEX elemen AREA HTML.

Sintaks:

areaObj.tabIndex = value areaObj.tabIndex

value adalah number (long) yang sedikitnya satu digit di dalam cakupan 0-9.

Contoh di bawah ini menetapkan atribut TABINDEX untuk semua elemen AREA:

<MAP NAME="mymap"> <AREA ID="areaID1" HREF="A.html" TITLE="Visit to A.html" ALT="Visit to A.html" SHAPE="rect" COORDS="5,5,95,195"> <AREA ID="areaID2" HREF="B.html" TITLE="Visit to B.html" ALT="Visit to B.html" SHAPE="rect" COORDS="105,5,195,195"> <AREA ID="areaID3" HREF="C.html" TITLE="Visit to C.html" ALT="Visit to C.html" SHAPE="rect" COORDS="205,5,295,195"> </MAP> <IMG SRC="image.png" ALT="Site map" USEMAP="#mymap" WIDTH="300" HEIGHT="200"> <SCRIPT TYPE="text/javascript"> var areaObj1 = document.getElementById("areaID1"); var areaObj2 = document.getElementById("areaID2"); var areaObj3 = document.getElementById("areaID3"); areaObj1.tabIndex = 1; areaObj2.tabIndex = 3; areaObj3.tabIndex = 2; </SCRIPT>

Sehingga semua elemen AREA akan seperti di bawah ini:

<MAP NAME="mymap"> <AREA ID="areaID1" HREF="A.html" TITLE="Visit to A.html" ALT="Visit to A.html" SHAPE="rect" COORDS="5,5,95,195" TABINDEX="1"> <AREA ID="areaID2" HREF="B.html" TITLE="Visit to B.html" ALT="Visit to B.html" SHAPE="rect" COORDS="105,5,195,195" TABINDEX="2"> <AREA ID="areaID3" HREF="C.html" TITLE="Visit to C.html" ALT="Visit to C.html" SHAPE="rect" COORDS="205,5,295,195" TABINDEX="3"> </MAP>