Pitmac1
Pitmac1

Reputation: 11

How to add an attribute to the finish button within jQuery-Steps?

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?

Upvotes: 1

Views: 2069

Answers (4)

Jitender Thakur
Jitender Thakur

Reputation: 600

Add the following in your steps

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

Upvotes: 0

Ryan Lintag
Ryan Lintag

Reputation: 23

Try this:

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

Upvotes: 0

Niranjan
Niranjan

Reputation: 45

Add this it works

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

Upvotes: 1

Bindiya Maharjan
Bindiya Maharjan

Reputation: 1

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');

Upvotes: 0

Related Questions