JavaScript Toggling multiple checkboxes toggle multiple checkboxes jquery,toggle multiple checkboxes,javascript toggle multiple

I can't seem to get jquery to toggle multiple checkboxes. I want to grab all the checkboxes on the page with a certain name and toggle them. Here is what I am currently trying but it just generates the error below and I am not sure why. What am I missing here?

$("input[name=recurringGridCheckbox]").prop("checked", !(this.prop("checked")));

Object doesn't support property or method 'prop'

Answer:1

There's a syntax error in rhe variable you use in the setter; this refers to the DOMElement, not the jQuery object and so does not have the prop() method available.

To fix this you can provide a function to the prop() method which will update the property based on its current state. Try this:

$("input[name=recurringGridCheckbox]").prop("checked", function(i, checked) {
    return !checked;
});
Answer:2

I try to implement an inpage shopping cart. When you click a picture of a product, the webpage shows detailed information of that product. Here's what Google Image Search does: Google Image Search ...

I try to implement an inpage shopping cart. When you click a picture of a product, the webpage shows detailed information of that product. Here's what Google Image Search does: Google Image Search ...

Ok, so I have a huge mapping project using leaflet and I've got the following overrides: //set defaults for popups L.Popup.options = { autoClose: false, closeButon: false }; ...

Ok, so I have a huge mapping project using leaflet and I've got the following overrides: //set defaults for popups L.Popup.options = { autoClose: false, closeButon: false }; ...

I am using streams to send notification between two applications. The applications are communicating through clusters via redis. Whenever, I push some notification from one app to another, it does not ...

I am using streams to send notification between two applications. The applications are communicating through clusters via redis. Whenever, I push some notification from one app to another, it does not ...

How do I add an index to a previously created object store, within the upgrade needed event? Doing this on a new object store is well documented: request.onupgradeneeded = function(event) { var db ...

How do I add an index to a previously created object store, within the upgrade needed event? Doing this on a new object store is well documented: request.onupgradeneeded = function(event) { var db ...

  1. adding index to existing table sql server
  2. adding index to existing table in mysql
  3. adding index to existing table oracle
  4. adding index to existing table
  5. adding column to existing index in oracle