J
J
Jack OXO2018-05-03 21:16:48
JavaScript
Jack OXO, 2018-05-03 21:16:48

How to show div on active radio?

Here is an example :
5aeb51c1c01a0187564761.png
It is necessary to show the div hidden in it with the active radio, and remove it when changing.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
Gleb Qeemerc, 2018-05-03
@oxojeck

If the div is in radio, then you can implement it like this:

$(".radio").click(function(){
// Прячем другие открытые блоки div
$(".hidden-content").removeClass("active");
// Добавляем div'y, который является потомком нажатого инпута класс active
$(this).children(div).addClass("active");
})

K
Kozebojka, 2018-05-03
@kozebojka

Seems like it should work

[type="radio"]:checked + .hidden-content{
  disply: block;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question