PetrIII,
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script>
$(function ()
{
var arr = [];
$("div[key]").each(function(i, el){
arr[i] = $(el).attr("key")});
alert(arr)
})
</script>
</head>
<body>
<div id="ctl00_PlaceHolderMain_peopleEditor_upLevelDiv" >
<span class="ms-entity-resolved">
<div id="divEntityData" key="User1"></div>
</span>
<span class="ms-entity-resolved">
<div id="divEntityData" key="User2"></div>
</span>
</div>
</body>
</html>