1

TLDR: How would one add an 'id' attribute to the finish button within jQuery.Steps.js?

When the finish button is called it looks like this within HTML:

<a href="#finish" role="menuitem">Finish</a>

This is what I want it to look like:

<a href="#finish" role="menuitem" id="example1">Finish</a>

Any ideas?

Pitmac1
  • 11
  • 4

4 Answers4

1

Add this it works

onInit :function (event, current) {
   $('.actions a[href=#finish]').attr('id', 'example1');
}
CertainPerformance
  • 356,069
  • 52
  • 309
  • 320
Niranjan
  • 47
  • 2
  • 7
  • That didnt work for me, I had to encapsulate the href with double quotes for it to work like so '.actions a[href="#finish"]' – Jon May 08 '19 at 15:24
0

You can define a class for this element and choose a selector for that class in below statement to add id named example1 to Finish element.

$('.some_selector').attr('id', 'example1');
isedev
  • 18,848
  • 3
  • 60
  • 59
0

Try this:

onInit :function (event, current) {
    $('.actions a[href=\\#finish]').attr('id', 'FinishButton');
}
0

Add the following in your steps

onInit: function (event, currentIndex) {
    $('.actions a[href="#finish"]').attr('id', "example1");
},
Jitender Thakur
  • 490
  • 5
  • 15