---
title: "jquery浏览器兼容性问题集"
author: "cairewen"
date: "2015-05-07T17:43:00Z"
tags: []
categories: ["Web前端"]
slug: "jquery"
draft: false
lastmod: "2015-05-07T17:43:00Z"
id: 2209221
url: "https://cairewen.iteye.com/blog/2209221"
---

1、jquery 获取&lt;select&gt; 标签选中值的用法，eg:

      IE8:$("#test [option:selected](http://optionselected/)").val()，不能用$("#test ").val()

      chrome:$("#test [option:selected](http://optionselected/)").val()或者$("#test").val()均可。

2、**具有 true 和 false 两个属性的属性，如 checked, selected 或者 disabled 使用prop()，其他的使用 attr()，例如：**$(“#test ”).prop(“checked”);

     判断是否选中等可以用jquery的is函数：var p = $(this).is(':checked');