getElement method


  • queryString String
  • returns Object
    • domNode DOM Node
    • type String


Method returns an object by it's ID containing DOM node reference and type. Note: Please use this method instead of document.querySelector() or similar because if we change something in our export file architecture in the future, your projects may break.


const color = loopic.getElement("homeTeamColor"); = "red";
color.domNode.innerHTML = "Example inner HTML";

Nested compositions

Accessing elements of the nested compositions is simple and all it requires is passing a composition dynamic id and a comma. After comma you can reference any element within that composition.

const playerOneOnField = loopic.getElement("_fieldComposition._player1");
const playerTwoOnField = loopic.getElement("_fieldComposition._player2");