jquery中获取radio选中值的正确写法

错误写法:

//只在IE下有作用,其他浏览器均获取的为第一个单选框的值
$('input[type=radio]').val();

正确写法为:

//兼容所有浏览器写法
$('input[type=radio]:checked').val();