Question: I'm trying to make a simple messenger for my school project

I need to store id number of each chat message inside himself (which is a div tag) and I want to access this value from JavaScript with id or name of div.

sorry for my bad English

Answer: 
You can store arbitrary data in custom attributes.

```
<div id="id1" any="value">

document.getElementById("id1").getAttribute("any");

```
Let assume a div tag's id equals to NumberID ( `<div id="NumberID"></div>` )

If you are gonna wanna use javascript,

```
var NumberID = document.getElementById("NumberID").innerHTML;

```

Then you can get the result from the NumberID variable.