Search code examples
javascriptjquerybulma

disable pagination button in bulma not working


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


Solution

  • 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.