On Radio Field Show/Hide

by shuja uddin

HTML

<div class="wrapper">
    <div class="row">
		  	<label class="radio-inline">
  			<input type="radio" id="PDOEmployee" name="pdo" value="PDOEmployee"> PDO Employee
			</label>
			<label class="radio-inline">
  			<input type="radio" id="PDOEmployeeWithFamily" name="pdo" value="PDOEmployeeWithFamily"> PDO Employee With Family
			</label>
		  	</div>
        
        
        <div class="row" id="PDOEmployee">PDOEmployee
                </div>
                
                <div class="row" id="PDOEmployeeWithFamily">PDO Employee With Family</div>
        
        
        </div>

CSS

.wrapper{
    padding:20px;
}

JavaScript

$(document).ready(function(){
    
    $("div#PDOEmployeeWithFamily").hide();
    
        $('input[type="radio"]').click(function(){
            if($(this).attr("value")=="PDOEmployee"){
                $("div#PDOEmployee").show();
                $("div#PDOEmployeeWithFamily").hide();
            }
            if($(this).attr("value")=="PDOEmployeeWithFamily"){
                $("div#PDOEmployeeWithFamily").show();
                $("div#PDOEmployee").hide();
            }
        });
    });