Home  >  Article  >  Web Front-end  >  Beginner to learn div css js and can’t understand the code_html/css_WEB-ITnose

Beginner to learn div css js and can’t understand the code_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:26:14902browse

$("#Sidebar li div").click(function ()
{
$("#Sidebar li div").removeClass('leftselected');
$(this). addClass('leftselected');
   });

Is this a callback function? What does ("#Sidebar li div").click mean? What does #Sidebar followed by two li and div mean?


Reply to the discussion (solution)

You need to look at some basic things, search for "jquery selector", and then you will understand.

You need to look at some basic things. Search for "jquery selector", and then you will understand.

("#Sidebar li div") is the div of the child element of li under the element Sidebar...that is, Sidebar is the parent element of li and li is the parent element of DIV. ·I am also just learning

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn