0

I have been looking at someone jquery code in jsf and I am not sure if I 100% clear I understand it all. The I am not clear on is the following syntax

    $('aclassname > input').each(function {}

What I am trying to understand is how the greater than symbol is working here. The 'aclassname' is a class attribute used on a div tag and this tag is wrapped round a input button. I know that the action is change an event on the button, but how does the greater than symbol work on this?

JAAulde
  • 19,250
  • 5
  • 52
  • 63
Andy5
  • 2,319
  • 11
  • 45
  • 91
  • 1
    This should help. Same rules as in CSS http://stackoverflow.com/questions/3225891/what-does-the-greater-than-sign-css-selector-mean – Mark Handy Jun 07 '16 at 18:31
  • The `>` is a child selector. If `aclassname` is a class, place a `.` before the class name. `$('.aclassname > input')` means: "find every element with the class name of, 'aclassname' , then select every input element that is *directly* under it. Directly under an element essentially children, if the children had children of it's own (grandchildren?), then those grandchildren would not be included in the selection. – zer00ne Jun 07 '16 at 18:33
  • "." is require before class name , without "." mean consider as tag. – Samyappa Jun 07 '16 at 18:35

0 Answers0