I am try to do something I thought was trivial but appears impossible: print the values of a css class associated with a div. Should be easy. Not for moi.
Your task: Using console.log() echo the value of top (or left or height, etc.) for the class associated with a div.
What am I missing?
UPDATE
Ok, more context:
Using pure Javascript - no JQuery I have done the following to create a div. insert it in the DOM, and assign a class to it:
// css class name
var sequenceDivClassName="igv-sequence-div",
classyDiv = document.createElement('div');
classyDiv.setAttribute('id', classyDivID);
parentDiv = document.getElementById(parentDivID);
parentDiv.appendChild(classyDiv);
document.getElementById(classyDivID).className = sequenceDivClassName;
Here is what the CSS class looks like:
.igv-sequence-div {
color:red;
position: absolute;
top: 0;
left: 0;
height: 15px;
width:100%;
}
I am doing all this in a Qunit unit test and I would like to do an assertion on the height. How do I access the height
field of the class so I can using it in an assertion - equal(...)
.