How can the CSS property of an element (e.g margin-left) be retrieved and then some value can be added to it, and the element gets altered with the updated value.
Suppose:
var element = document.getElementById("myElement");
var value = element.style.margin-left;
//How to do something like this?
var updatedValue = value + 10;
element.style.margin-left = updatedValue;
As, style.margin-left accepts values in pixels. How to retrieve the current value, then add something to it, then update the element with the same?
Thank you.