Skip to content

Commit 0354f94

Browse files
committed
renaming function parameter
1 parent 7061412 commit 0354f94

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

index.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,26 @@
1010
//All 3 functions take in the HTML name attribute of a certain group of input elements & performs the action (select all, none, invert) ONLY ON THAT GROUP
1111

1212
//Select all items in a group when given the HTML name attribute of some input elements in a group
13-
function selectAll(nameToInvert){
14-
var inputs=$("input[name='"+nameToInvert+"']"); //array of inputs with the "name" attribute matching "nameToInvert", the argument passed in
13+
function selectAll(nameGroupToToggle){
14+
var inputs=$("input[name='"+nameGroupToToggle+"']"); //array of inputs with the "name" attribute matching "nameGroupToToggle", the argument passed in
1515
$.each(inputs, function(index){ //iterate over each item in "inputs" array
1616
var element=$(inputs[index]); //get HTML object of each input element in the array
1717
element.prop("checked", true); //Adds the property to all inputs. Doesn't matter if it's already true, changes the value to true anyway (redundant but not harmful)
1818
});
1919
}
2020

2121
//Same structure as "selectAll()" but it changes the "checked" property to "false" to unselect each item
22-
function selectNone(nameToInvert){
23-
var inputs=$("input[name='"+nameToInvert+"']");
22+
function selectNone(nameGroupToToggle){
23+
var inputs=$("input[name='"+nameGroupToToggle+"']");
2424
$.each(inputs, function(index){
2525
var element=$(inputs[index]);
2626
element.prop("checked", false); //deselect the item
2727
});
2828
}
2929

3030
//iterate through an array of input elements & negate the "checked" property
31-
function invert(nameToInvert){
32-
var inputs=$("input[name='"+nameToInvert+"']"); //array of inputs with the "name" attribute matching "nameToInvert", the argument passed in
31+
function invert(nameGroupToToggle){
32+
var inputs=$("input[name='"+nameGroupToToggle+"']"); //array of inputs with the "name" attribute matching "nameGroupToToggle", the argument passed in
3333
$.each(inputs, function(index){ //iterate over each item in "inputs" array
3434
var element=$(inputs[index]); //get HTML object of each input element in the array
3535

0 commit comments

Comments
 (0)