Roszadok
Roszadok

Reputation: 39

Uncheck checkboxes in parent context

I'm trying to uncheck checkboxes, with something like this

$(':checkbox:checked').prop('checked',false);

But it ocurred that i'm in other context and I can catch it by

this.window.parent.document;

I would like to connect both like

var z = this.window.parent.document;
z.(':checkbox:checked').prop('checked',false);

But I have no clue how to do it.

Upvotes: 0

Views: 67

Answers (2)

Clément Andraud
Clément Andraud

Reputation: 9269

$(this.window.parent.document).find(':checkbox:checked').prop('checked',false);

Like that ;)

Upvotes: 1

Anton
Anton

Reputation: 32581

You need to wrap z with jQuery $() and use .find()

$(z).find(':checkbox:checked').prop('checked',false);

Upvotes: 1

Related Questions