キーと値がセットになったハッシュを渡すことで、全ての要素のstyle属性を設定します。 全ての要素に同じスタイルをセットしたい場合に便利です。 <p> Move the mouse over a paragraph. </p> <p> Like this one or the one above. </p> $("p").hover(function () { $(this).css({ backgroundColor:"yellow", fontWeight:"bolder" }); }, function () { var cssObj = { backgroundColor: "#ddd", fontWeight: "", color: "rgb(0,40,244)" } $(this).css(cssObj); });