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: 
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.
```
divID = 'the id of your div';
content = 'the content you want in that div';
div = document.getElementById(divID);
div.innerHTML(content);

```

Documentation:

[.getElementByID](https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementById)

[.innerHTML](https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML)