I am a newcomer to the JS world and facing a seemingly simple challenge: I need to specify the position of an element that will be added to another element, but I want to set the position within the application code instead of in .css.
Currently, my code looks like this:
var obj = DOM.div({className: 'testPlace'},
React.createElement("a", {id: 'testPlace'},".")
);
And in the .css file:
div.testPlace { position: absolute;
right: 50px;
bottom: 100px;
}
My goal is to define the parameters for the right and bottom positions inside the app code itself, rather than in .css. Any suggestions on how I can achieve this?
Appreciate your help!