Такой вот тебе пример замастырил...
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<!--
<script src="https://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
-->
<style>
.off {
color: red;
}
</style>
<script>
document.addEventListener('DOMContentLoaded', _ => {
const s = 25
document.querySelectorAll('table input').forEach(_ => {
const r = _.parentNode.parentNode
if (+_.value < s) {
_.disabled = true
if (!r.classList.contains('off')) r.classList.add('off')
} else {
_.disabled = false
if (r.classList.contains('off')) r.classList.remove('off')
}
})
})
</script>
</head>
<body>
<table>
<tr class='off'>
<td><input value='10' name="Product" type="radio" disabled />10</td>
</tr>
<tr class='off'>
<td><input value='20' name="Product" type="radio" disabled />20</td>
</tr>
<tr class='off'>
<td><input value='30' name="Product" type="radio" disabled />30</td>
</tr>
</body>
</html>
|