It might be a newbie question so I appologize in advance.
I added an element (header) to a div in javascript and I want to change it's position. For some reason this is not possible.
Below is a code sample.
Any idea what I am missing?
var header = document.createElement("H7");
var text = document.createTextNode(cardNum);
header.appendChild(text);
header.style.position="relative";
header.style.left="400";
//i and j are indexes
document.getElementsByClassName('masonry-column')[j].getElementsByClassName('subject-details')[i].appendChild(header);
Update: Updated the code and the issue still remains. There are no errors in the console, the styles just do not take affect.
header.style.position = 'relative'andheader.style.left = 400. After that, you just need one line to append if to the header.iandjare. 2) relevant error messages. Did you check for script errors? 3) the accompaniing HTML snippet, and preferably a jsfiddle that reproduces the problem 4) a basic lack of understanding about the problem in general (or so it seems).