How to set the transform attribute of an element dynamically?

dynamically set the properties of transform to offset different locations according to the status obtained by the backend.

Jan.11,2022

var ele = document.getElementById("dom");

ele.style.transform = "translateX(10px)";

ele.style.transform = "translateX(10px) rotate(20deg)";
Menu