I am doing a project where I need two radio buttons for date selection.One radio button takes the system date and prints but the other button when I select,I want the user to be
<table border="1" width="100%">
<tr>
<th> Date</th>
</tr>
<td>
Current date<input type="radio" name="zing" id="foo" checked/>
Add date<input type="radio" name="zing" id="bar"/>
<input type='text' id='txtDate' style='display:none'/>
</td>
</table>
then write down below script
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" ></script>
<script>
$(document).ready(function(){
$("#bar").change(function(){
$("#txtDate").show();
});
$("#foo").change(function(){
$("#txtDate").hide();
});
});
</script>
Try this
$(function(){
$("input:radio:first").click();
});