「jQuery」$.supportでブラウザのサポート状況を取得する
書式
$("セレクタ名").click(function(){
$.each($.support, function(p, v){処理コード
$.supportを使用してブラウザのサポート状況を取得します
$.supportで取得できるプロパティの一覧
.ajax ブラウザがXMLHttpRequestオブジェクトを作成できるかどうか .changeBubbles changeイベントがバブリングするかどうか cssFloat cssFloatプロパティが使用できるかどうか .optSelected デフォルト選択のoption要素でselectedが機能するかどうか
使用例
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$(function(){
$("#btnProp").click(function(){
$.each($.support, function(p, v){
alert(p, v);
})
});
});
</script>
</head>
<body>
<input type="button" id="btnProp" value="検証">
</body>
</html>
結果
「検証」ボタンを押すと、$.supportで取得できる値を表示します