JQuery 常用

时间:2023-03-08 15:57:10
JQuery  常用

1、同一name分组的多个radio,获取选中radio的value值:

var check_val=$("input[name='属性名']:checked").val();

2、鼠标移入移出hover事件代码:

$("#a").hover(function () {
  $(this).css("background-color", "red");//移入
}, function () {
  $(this).css("background-color", "white");//移出
});