What I have:
A list of groups that basically consists of main data points: link, name and cover image. Each group's code looks like this:
<a href="/group/ololo" class="group-item">
<h1>Group Name</h1>
<img src="path/to/the/image.png" />
</a>
Therefore a.href is the link, h1 consists the name and img.src is the image.
What I need:
I need to create a model representation of each group, so that I can access it simply with group.link, group.name and group.image.
I consider creating a class with constructor and setting all the fields manually and it, actually, works. What I want to do is extend the Node class for it to add those fields to the object, if I'm trying to access a.group-item. An example of what I want are special Nodes, like input[type=text], that has a .value variable or input[type=checkbox] that has .checked variable.
How is it possible to extend the Node class that way? Also, I do not want to use any frameworks for that, only pure js. Thank you!