Create Element And Set Attributes Javascript Substring From Right