TagHelper+Layui封装组件之Radio单选框 标签名称:cl-radio 标签属性: asp-for:绑定的字段,必须指定 asp-items:绑定单选项 类型为:IEnumerable<SelectListItem> 太简单了,直接上代码了 RadioTagHelper代码 using System; using System.Collections.Generic; using Microsoft.AspNetCore.Mvc.Rendering; using Microsof
$(function(){ $('input[name="rad"]').click(function(){ var $radio = $(this); // if this was previously checked if ($radio.data('waschecked') == true) { $radio.prop('checked', false); $radio.data('waschecked', false); } else $radio.data('wascheck