Пожалуйста, помогите изменить код, чтобы в нем не было вызова функции (код будет размещен в функции другого JS). (Без onclick или onchange в инпуте radio. Без jQuery)
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Актуальные контакты:
Telegram: @Nikker_web
E-Mail: tarasevich.email@gmail.com
Портфолио https://www.behance.net/d4d4186e
Разрабатываю дизайн групп в соц сетях, сайтов, приложений, другой дизайн под заказ
Актуальные контакты:
Telegram: @Nikker_web
E-Mail: tarasevich.email@gmail.com
Разрабатываю дизайн групп в соц сетях, сайтов, приложений, другой дизайн под заказ
Портфолио https://www.behance.net/d4d4186e
Question
sashka
Здравствуйте
При активном радиоботтоне нужно скрыть див с содержимым, для этого используется JS:
<script type="text/javascript">var inp = document.getElementsByName('shipping_rate_id'); myadresLab = document.getElementById('vm_myadres_div'); myadresInp = document.getElementById('vm_myadres_input') pasportLab = document.getElementById('vm_pasport_div'); pasportInp = document.getElementById('vm_pasport_input');function func (elm) { if (elm.id == "hashd5561dda4545a69195256a8ee62fcc91" && elm.checked){//Самовывоз radiobutton myadresLab.style.display = "none"; myadresInp.style.display = "none"; pasportLab.style.display = "none"; pasportInp.style.display = "none"; } else if (elm.id == "hasha917f3643fcc7141bc83f55fb83a6c62" && elm.checked){//Доставка по Москве radiobutton myadresLab.style.display = ""; myadresInp.style.display = ""; pasportLab.style.display = "none"; pasportInp.style.display = "none"; } else{ myadresLab.style.display = ""; myadresInp.style.display = ""; pasportLab.style.display = ""; pasportInp.style.display = ""; }}for (var i=0;i<inp.length;i++){ inp[i].onchange = function () {func(this)};}</script>вот пример в работе: http://www.glassbus.ru/Untitled-14.html
Пожалуйста, помогите изменить код, чтобы в нем не было вызова функции (код будет размещен в функции другого JS).
(Без onclick или onchange в инпуте radio. Без jQuery)
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.