获取单个css属性值,传属性名,返回字符串
获取多个css属性值,传数组,返回对象
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>css样式</title>
<style>
.one {
width: 100px;
height: 100px;
border: 1px solid #ff6700;
}
</style>
</head>
<body>
<div class="one">div</div>
<script src="http://code.jquery.com/jquery-3.4.1.js"></script>
<script>
$('.one').click(function() {
console.log($(this).css('width'));
console.log($(this).css(['width', 'border']))
})