Edit in JSFiddle

 <div name="equal">equal</div>
 <div name="equal">equal</div>
<div name="different">different</div>
 <div name="equal">Почему этот не подсвечивается ? equal</div>

<div name="different">different</div>
<div name="different">different</div>
 <div name="equal">equal</div>
<div name="different">different</div>
<div name="different">different</div>

 <div name="equal">equal</div>
[name=equal]:nth-child(2){color:red;}
[name=equal]:nth-child(3){color:red;}
document.querySelectorAll('[name=equal]')[2].style.color = 'red'