如何在单选按钮的基础上交替显示和隐藏两个div [英] how can show and hide two div's alternatively on the basis of radio button selection
本文介绍了如何在单选按钮的基础上交替显示和隐藏两个div的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在同一个
中有两个div,并且我使用了2个单选按钮.现在当我单击一个单选按钮时,div1应该可见,div2应该不可见;如果我选择第二个单选按钮,则第二个div应该可见,而第一个应该不可见. 谢谢. |
i have two div into same
and i use 2 radio buttons . now when i click one radio button then div1 should visible and div2 should be invisible and if i select 2nd radio button then 2nd div should be visible and 1st one should be invisible . Thank you . |
推荐答案
jQuery在这里生效.参见,
jQuery comes in action here. See,
(" ).click(
("#radio-btn-1").click(function() {
( ).fadeIn();
("#div1").fadeIn();
这篇关于如何在单选按钮的基础上交替显示和隐藏两个div的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文