Edit in JSFiddle

 <h2>これにはヒットしない<h2>
 
<h2 title="タイトル内容">ヒットする<h2>
 
<h2 title="">ヒットする<h2>
h2[title] {
  color : red;
}