Показать сообщение отдельно
  #6 (permalink)  
Старый 26.03.2018, 02:04
Аватар для рони
Профессор
Отправить личное сообщение для рони Посмотреть профиль Найти все сообщения от рони
 
Регистрация: 27.05.2010
Сообщений: 33,141

angel026,
насколько я вас понял ...
<!DOCTYPE html>

<html>
<head>
  <title>Untitled</title>
  <meta charset="utf-8">

  <script>
     window.addEventListener('DOMContentLoaded', function() {
       [].forEach.call(document.querySelectorAll('.choose_check'), function(item) {
               item.addEventListener('change', function() {
                   var parent = item.parentNode;
                   var url = parent.querySelector('.choose_check_url')
                   url.checked = item.checked
               });
           });
         });
  </script>
</head>

<body>
<label><input class="choose_check" id="cc_6" name="check[]" value="
                            cpu-test-22
                            CPU AMD-22
                            9002
                            ₽
                            " onchange="getCheckedCheckBoxes()" type="checkbox"><input class="choose_check_url" id="cc_url_6" name="check[]" value="'.index.php?option=com_virtuemart&amp;view=productdetails&amp;virtuemart_product_id=13 &amp;tmpl=component'" type="checkbox"></label>

<br>
<label><input class="choose_check" id="cc_6" name="check[]" value="
                            cpu-test-22
                            CPU AMD-22
                            9002
                            ₽
                            " onchange="getCheckedCheckBoxes()" type="checkbox"><input class="choose_check_url" id="cc_url_6" name="check[]" value="'.index.php?option=com_virtuemart&amp;view=productdetails&amp;virtuemart_product_id=13 &amp;tmpl=component'" type="checkbox"></label>
<br>
<label><input class="choose_check" id="cc_6" name="check[]" value="
                            cpu-test-22
                            CPU AMD-22
                            9002
                            ₽
                            " onchange="getCheckedCheckBoxes()" type="checkbox"><input class="choose_check_url" id="cc_url_6" name="check[]" value="'.index.php?option=com_virtuemart&amp;view=productdetails&amp;virtuemart_product_id=13 &amp;tmpl=component'" type="checkbox"></label></body>
</html>
Ответить с цитированием