Показать сообщение отдельно
  #3 (permalink)  
Старый 19.06.2016, 23:34
Аватар для рони
Профессор
Отправить личное сообщение для рони Посмотреть профиль Найти все сообщения от рони
 
Регистрация: 27.05.2010
Сообщений: 33,070

strsin,
вариант для неправильного id
<!DOCTYPE html>

<html>
<head>
  <title>Untitled</title>
  <meta charset="utf-8">
  <style type="text/css">
     td{
       border: solid 3px rgb(128, 0, 128);
       background-color: rgb(255, 255, 0);
     }

 </style>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
  <script>
$(function() {
    $("tr").each(function() {
        "Viktor Pupkin" == $("#nm", this).text() && $("#fhrpr", this).text(function(b, a) {
            5 <= +a && $(this).css({
                color: "Blue"
            })
        })
    })
});
  </script>
</head>

<body>
<table width="400" summary="" >
	<thead>
		<tr>
			<th>name</th>
			<th>num</th>

		</tr>
	</thead>
	<tbody>
		<tr>
			<td id = "nm">Viktor Pupkin</td>
			<td id = "fhrpr">1</td>
		</tr>
		<tr>
			<td id = "nm">Viktor Pupkin</td>
			<td id = "fhrpr">5</td>

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