Share this post:
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;
- Mysql procedure with pagination in laravel 5?
- How to create and use Middleware in Laravel 5?
- How to get Query Strings Value in Laravel 5?
- Laravel 5 mailchimp api integration from scratch with example
- Laravel 5 create Custom Validation Rule example.
- How to create custom helper in Laravel 5?
- How to clear log file using command in laravel 5 ?
- Laravel 5 Twitter OAuth using Socialite Package