Sometimes, you have a many tag with same class and attribute with value, but you need to find maximal value of attribute from that comman class, In bellow you have same html tag:
<li class="test" data-id="3">hi</li>
<li class="test" data-id="5">hey</li>
<li class="test" data-id="1">hello</li>
Now, you require to get max value, i mean you need to 5, because that is big value from other, so you can get maximal value from this way:
var max = 0;
var value = parseInt($(this).data('id'));
max = (value > max) ? value : max;
- How to connect mysql database in node js with example?
- CRUD (Create Read Update Delete) Example in Laravel 5.2 from Scratch
- Jquery - draggable sortable table rows example demo with bootstrap
- AngularJS - sorting(using orderby filter) table data example with demo
- Jquery highlight search text in div using highlight JS with example
- How to Solve overwrite index.php in windows wampserver ?
- Solve - Installation request for guzzle/guzzle in laravel
- How to fix and recover a “corrupt history file” in zsh?