Показать сообщение отдельно
  #9 (permalink)  
Старый 29.08.2016, 10:49
Аватар для рони
Профессор
Отправить личное сообщение для рони Посмотреть профиль Найти все сообщения от рони
 
Регистрация: 27.05.2010
Сообщений: 33,072


<!DOCTYPE html>

<html>
<head>
  <title>Untitled</title>
  <meta charset="utf-8">
  <style type="text/css">
  </style>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
  <script>
$(function() { var min,max;

  var prices	= $('.price').text().match(/\d+/g).sort(function(a,b) {
  return a - b
}),
    min		= prices[0],
    max		= prices[ prices.length - 1 ];


alert([min,max])
});
  </script>
</head>

<body>
<div class="price">2000 грн</div>
<div class="price">1000 грн</div>
<div class="price">3000 грн</div>
<div class="price">9 грн</div>



</body>
</html>
Ответить с цитированием