# Basic State Definition – DOM Ready State

The most basic use case for a state is the DOMContentLoaded event handle. This will create a JENTIS State in your JTM account that activates on the named web browsers event. Further details on this api and specs can be found here: [DOMContentLoaded event – Web APIs | MDN](https://developer.mozilla.org/en-US/docs/Web/API/Window/DOMContentLoaded_event)

{% code title="DOM Ready State - Javascript Function" lineNumbers="true" %}

```javascript
function(initState) {
  document.addEventListener('DOMContentLoaded', (event) => {
    initState();
  });
};
```

{% endcode %}

With this State in place, your DCP will react as soon as the event is triggered in a user's browser, activating all triggers, checking conditions, and calculating all Frontend Variable values. So, with this state, you are ready to go if this event fits your requirements.

\\
