edon
edon

Reputation: 1

How can i call aria-label if it start with "Example"

I'm trying to solve this puzzle.

I have this script:

$('button[aria-label="Exam"]').trigger('click');

But I need to get also all those that start with Exam for example "Exam 1" or "Exam 202".

Upvotes: 0

Views: 347

Answers (1)

Mamun
Mamun

Reputation: 68923

You can use Attribute Starts With Selector [name^="value"] that selects elements that have the specified attribute with a value beginning exactly with a given string.

$('button[aria-label^="Exam"]').trigger('click');

Upvotes: 1

Related Questions