L
L
lilandre2018-02-09 12:13:10
JavaScript
lilandre, 2018-02-09 12:13:10

How to replace text on pagination buttons?

Good afternoon. I'm trying to access the pagination button with the number "2", but as I understand it, there are some problems with the Dom tree . How do I initialize the Dom tree in such a way that=buttons can respond to events ?
Audi

jQuery(document).ready(function() { 

    jQuery('.pagination li:nth-child(2)').bind('click', function(){
        alert('Click on area.');
    })

});

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stimulate, 2018-02-09
@Stimulate

jQuery('.pagination li:nth-child(2) a').bind('click', function(){
        alert('Click on area.');
    });
/*заменить текст соответственно*/
jQuery('.pagination li:nth-child(2) a').text('Hello');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question