Here I want show only 10 items. How can break if counter == 10 ?
- var counter = 1;
- $("#update").click(function() {
- var btnView = 'View';
- $('#clearbtn-' + (count - 1)).append(btnView);
- counter++;
- });
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Ranjeet PatraPosted Apr 12, 2017, 5:39 AM
Abhilash J APosted Apr 12, 2017, 5:29 AM
Midhun TpPosted Apr 12, 2017, 5:24 AM
Shakti Singh DulawatPosted Apr 12, 2017, 4:21 AM
To
breakaloop, you have to returnfalsein the loop callback.Returning
trueskips to the next iteration, equivalent to acontinuein a normal loop.