Other answers that use getBoundingClientRect work, but if you want to get the actual numeric values ββfrom the translate3d string, use RegExp :
var xyzArray; let translate3dValue = 'translate3d(256px, 512px, 0px)'; xyzArray = translate3dValue.replace(/translate3d|px|\(|\)/gi, '').split(',');
Benny source share