You can access an attribute of an element in HTML. Although it's not really an HTML variable, it's roughly close to it. As you expect from a variable, you can get, set and remove it.
Element.getAttribute() :
getAttribute() returns the value of a specified attribute on the element. If the given attribute does not exist, the value returned will either be null or "" (the empty string); see Notes for details : https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttribute
Example :
let myDiv = document.getElementById("myDiv");
console.log(myDiv.getAttribute("variable"))
<div class="div" id="myDiv" variable='test'</div>
Of course, you can set, or remove an attribute too :
Element.setAttribute()
Sets the value of an attribute on the specified element. If the
attribute already exists, the value is updated; otherwise a new
attribute is added with the specified name and value.
Element.removeAttribute()
Blockquote
removeAttribute removes an attribute from the specified element.
Note:
This being said, you will need javascript to interact with attributes. And that explains partially why it's not a "proper variable".
+operator for arguments. It's a markup language, not a programming language.