Answers for "jquery find index of this"

2

jquery index of element

$("#wizard li").click(function () {
    console.log( $(this).index() );
});
Posted by: Guest on December-29-2020
0

jquery get element by index

$('ul li').eq(index).css({'background-color':'#343434'});
Posted by: Guest on March-18-2021
0

jquery find index of this

$(document).ready(function() {

    $("#example div").click(function() {
        var index = $("#example div").index(this);
        $("#example_index").html("Index " + index + " was clicked");
    });
   
});
Posted by: Guest on March-07-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language