You are making an assumption about the DOM structure here and for a person not familiar with the entityselector it is very hard to understand what you want to achieve here. (1) Use a more descriptive variable name like <code>propertyId</code>. (2) Can't you query entityselector's <code>selectedEntity()</code> method for the property id?