I have a type radio button
<input type="radio" name="user-type" value="Store"> <input type="radio" name="user-type" value="Brand">
I tried writing a jQuery script as
if($("input[name=user-type]:checked").val()) == "Brand"){ $(".showstore").hide(); $(".showbrand").show(); }
and also tried
if($("input[name=user-type]:checked").val()) == "Brand").click(function(){ $(".showstore").hide(); $(".showbrand").show(); });
and also tried
if ( $("input[name=user-type]:radio").val() == "Brand"){ $(".showstore").hide(); $(".showbrand").show(); }
None of this was, any correction is evaluated. Thanks.
Update1
I tried this way and it will hide
if($("input[name=user-type]:checked").val() == "Brand"){ $(".showstore").hide(); $(".showbrand").show(); } else if($("input[name=user-type]:checked").val() == "Store"){ $(".showstore").show(); $(".showbrand").hide(); }
javascript jquery
lock
source share