.split("1px") into ["1px",1,"px"] in Javascript
- by Jay
I'm rubbish at Regular Expressions, really!
What I'd like is to split a string containing a CCS property value into an array of [string,value,unit].
For example: if I supplied the .split() method with 1px it'd return ["1px",1,"px"]. If I were to supply, similarly, 10% it'd return ["10%",10,"%"].
Can this be done?
I appreciate all your help!