Jquery parse string

I have an object with id "4x153x9x10x173" and I need to "4x153x9x10x173" integer "153" from it in a variable using jquery?

 objects.last().attr('id') // id = 4x153x9x10x173 
+6
source share
1 answer
 var desired = objects.last().attr('id').split('x')[1]; 

jsFiddle demo

+12
source

Source: https://habr.com/ru/post/915576/


All Articles