Block id = "passport" by default is invisible. The task is to make the block with id = "passport" visible, if radio with the attribute value = '65 'is selected (active), if you select another radio, then hide the block with id = "passport".
Stopped in syntax, does not find value = '65 '. And maybe the logic is not true in this solution of the problem. I ask for help, is the correct way of thinking in solving the problem?
var subtree = document.getElementById('frameDelivery');//поиск в поддереве элемента с ID frameDelivery var elems = subtree.getElementsByTagName( 'input' );// находим всех потомков input и записываем в коллецию. //далее, осуществляем перебор элементов с условием, - ищем элемент с атрибутом value='65', как только нашли выполняем первое условие. for (var i = 0; i < elems.length; i++) { if (elems[i].getAttribute('value', 65) == 65) { /*if(true){ //первое условие: делаем снова проверку, активно ли данное radio, если да (checked="checked"), то выполнить код - назначить событие. Где, делаем видимым скрытый блок. } else { //если выбрали другой radio, то скрыть блок с id="passport" } */ } else { alert('Элемент не найден!'); } } #passport { display: none; } <div class="groups-form"> <div class="frame-label" id="frameDelivery"> <span class="title">Способ получения</span> <div class="frame-form-field check-variant-delivery"> <div class="frame-radio"> <div class="frame-label"> <span class="niceRadio b_n"> <input type="radio" required name="deliveryMethodId" value="63"> </span> <div class="name-count"> <span class="text-el">Самовывоз</span> </div> </div> <span onclick="popupme(this); return false;" class="modal" data-type="delivery" data-target="63">Подробнее</span> <div class="frame-label"> <span class="niceRadio b_n"> <input type="radio" required name="deliveryMethodId" value="66"> </span> <div class="name-count"> <span class="text-el">Доставка курьером</span> </div> </div> <span onclick="popupme(this); return false;" class="modal" data-type="delivery" data-target="66">Подробнее</span> <div class="frame-label"> <span class="niceRadio b_n"> <input type="radio" required name="deliveryMethodId" value="64"> </span> <div class="name-count"> <span class="text-el">Доставка с монтажом</span> </div> </div> <span onclick="popupme(this); return false;" class="modal" data-type="delivery" data-target="64">Подробнее</span> <div class="frame-label"> <span class="niceRadio b_n"> <input type="radio" required name="deliveryMethodId" value="65"> </span> <div class="name-count"> <span class="text-el">Транспортной компанией</span> </div> </div> <span onclick="popupme(this); return false;" class="modal" data-type="delivery" data-target="65">Подробнее</span> </div><!--end frame-radio--> </div><!--frame-form-field--> </div><!--frame-label--> </div><!--groups-form--> <div class="groups-form" id="passport"> <div class="frame-label"> {echo ShopCore::app()->CustomFieldsHelper->setRequiredHtml('<span class="must"></span>')->setPatternMain('pattern_custom_field')->getOneCustomFieldsByName('passportSeriesNumber','order')->asHtml()} </div> </div>