Edit in JSFiddle

$("h1").add("h2").css("background-color","yellow");
<h1>h1 요소 입니다.</h1>
<h2>h2 요소 입니다.</h2>