1.写
<!DOCTYPE html> <html> <head> <title></title> <script language="javascript" src="jquery.min.js"></script> </head> <body> <form> <input type="radio" name="sex" value="1"> <input type="radio" name="sex" value="2"> <input type="radio" name="sex" value="3"> </form> </body> </html>
2.获取值
<script> $value=$("input[name='sex']:checked").val(); </script>
3.回显
<form> 男<input type="radio" name="sex" value="1" <{if $data.sex=1 }> checked <{/if}>> 女<input type="radio" name="sex" value="2" <{if $data.sex=2 }> checked <{/if}>> 不明<input type="radio" name="sex" value="3" <{if $data.sex=3 }> checked <{/if}>> </form>