1

can i change this button click

$('input[name="submit.one-click-premium-de.x"]').click().first();

to a button that has a wild card after first words?

$('input[name="submit.one-click*"]').click().first();

or something?

When the Button Name start with submit.one-click i will click this.

All things after "one-click" is okay. So i want like a wildcard there... My click on top works but i want to have a start with one-click button... I tried much strange things but thats not working

j08691
  • 204,283
  • 31
  • 260
  • 272
Scholli
  • 419
  • 1
  • 6
  • 15
  • I closed your question as a duplicate of the one linked above, and while you're not using the ID, the same syntax in the answer holds. – j08691 Apr 03 '17 at 18:17

2 Answers2

3

^= is the startsWith selector:

$('input[name^="submit.one-click"]').click().first();

https://api.jquery.com/attribute-starts-with-selector/

tymeJV
  • 103,943
  • 14
  • 161
  • 157
0

You can use ^= to do this. It works this way:

$('input[name^="submit.one-click"]').click().first();
Joseph Beard
  • 177
  • 3
  • 13