CSS
<!DOCTYPE html>
<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>溫故而知“心”</title>
<style>
</style>
</head>
<body>
<div class="demo"></div>
</body>
<script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
<script>
$('.demo')
.css({ width: '100px', height: '100', backgroundColor: '#ff0000' })
.css({ width: 300 })
console.log($('.demo').css("width"))
console.log($('.demo').css("backgroundColor"))
</script>
</html>
attr
<!DOCTYPE html>
<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>溫故而知“心”</title>
<style>
</style>
</head>
<body>
<div class="demo" xyz="aa"></div>
<input type="checkbox" checked=''>
</body>
<script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
<script>
console.log($('.demo').attr('class'))
console.log($('.demo').attr('xyz'))
$('.demo').attr('id', 'lm')
console.log($('input').attr('checked'))
</script>
</html>
prop
<!DOCTYPE html>
<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>溫故而知“心”</title>
<style>
</style>
</head>
<body>
<div class="demo" xyz="aa"></div>
<input type="checkbox" checked=''>
</body>
<script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
<script>
console.log($('.demo').prop('class'))
console.log($('.demo').prop('xyz'))
console.log($('input').prop('checked'))
$('div').prop('id', 'lm')
</script>
</html>