Maks K
Maks K

Reputation: 3914

How to handle click on button without ID but with value?

The third-party library provides web SDK with a button without ID but with value? So, I could not add the ID to it.

How to handle click (like getElementbyId) and add the listener to it?

<input value="Some Value">

Upvotes: 0

Views: 474

Answers (1)

Anastasiia Solop
Anastasiia Solop

Reputation: 1493

You can use querySelector for that to get the input with a specific value, like that

document.querySelector('input[value="Some Value"]');

Upvotes: 1

Related Questions