list - jquery find index of element with selector -
I'm trying to use jQuery's .index () function and I can understand how it works Does. There are no results which I expect from them. This is a little example why I do not get it: HTML: & lt; div id = "gallery" & gt; & Lt; Div class = "gallery-item" & gt; Item 1 & lt; / Div & gt; & Lt; Div class = "gallery-item active" & gt; Item 2 & lt; / Div & gt; & Lt; Div class = "clear view-LG" & gt; & Lt; / Div & gt; & Lt; Div class = "gallery-item" & gt; Item 3 & lt; / Div & gt; & Lt; Div class = "gallery-item" & gt; Item 4 & lt; / Div & gt; & Lt; / Div & gt; & Lt; Div id = "button" & gt; & Lt; Button ID = "Next" & gt; Next & lt; / Button & gt; & Lt; / Div & gt; & Lt; Span id = "console" & gt; & Lt; / Span & gt; js: jquery (document) .ready (fu...