0

I have bulma pagination component like this:

<nav class="pagination">
   <a class="pagination-previous">Previous</a>
   <a class="pagination-next">Next page</a>
</nav>

my purpose is to disable pagination-next button via jquery using prop function:

$('.pagination-next').prop('disabled', true);

but is not working at all, did I do something wrong ? what is the problem with it

thank you

YouneL
  • 8,152
  • 2
  • 28
  • 50

2 Answers2

2

Try the following

$(".pagination-next").attr("disabled","disabled");

In general I don't think anchors can be disabled as such.

jQuery disable a link

This seems to be what you're after.

Rstew
  • 585
  • 2
  • 9
  • 21
1

Changing it to .attr() makes it work.
Like this $('.pagination-next').attr('disabled', true);

Referencing jQuery documentation: http://api.jquery.com/
Description: Get the value of a property for the first element in the set of matched elements

so the .prop()only gets the propery and not setting it. .attr() sets and gets attributes like the way you want it to.