Finds all inputs that are not checked and highlights the next sibling span. : Selector Form « jQuery « JavaScript DHTML






Finds all inputs that are not checked and highlights the next sibling span.

  


<html>
  <head>
    <script type="text/javascript" src="js/jquery-1.3.2.js"></script>
    <script type="text/javascript">
        $(document).ready(function(){
               $("input:not(:checked) + span").css("background-color", "yellow");

        });
    </script>

  </head>
  <body>
    <body>
    <div>
        <input type="checkbox" name="a" />
    
        <span>A</span>
      </div>
      <div>
        <input type="checkbox" name="b" />
        <span>B</span>
      </div>
      <div>
        <input type="checkbox" name="c" checked="checked" />
    
        <span>C</span>
    </div>

    </body>
</html>

   
    
  








Related examples in the same category

1.image() matches all input elements of type image.
2.input() matches all input, textarea, select and button elements.
3.Get all form children
4.password() matches all input elements of type password.
5.radio() matches all input elements of type radio.
6.reset() matches all input elements of type reset.
7.submit() matches all input elements of type submit.
8.text() matches all input elements of type text.
9.checked() matches all elements that are checked.
10.disabled() matches all elements that are disabled.
11.enabled() matches all elements that are enabled.
12.selected() matches all elements that are selected.
13.Finds all button inputs.
14.Finds all inputs that don't have the name 'n'
15.Finds all inputs that have an id attribute and whose name attribute ends with man and sets the value.
16.Finds all inputs with name 'ab'
17.Finds all inputs with an attribute name that ends with 'b'
18.Finds all inputs that with a name attribute that contains 'a'
19.checkbox() matches all input elements of type checkbox.
20.Shows all hidden divs and counts hidden inputs.
21.file() matches all input elements of type file.
22.Finds the button with no siblings in each matched div and modifies look.
23.Get disabled form fields
24.Get enabled form fields
25.Find the very next sibling of each disabled button and change its text "this button is disabled".
26.Finds all inputs of type radio within the first form in the document