Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个带有 id 的对象,"4x153x9x10x173"我需要"153"使用 jquery 将整数从它解析成一个变量?
"4x153x9x10x173"
"153"
objects.last().attr('id') // id = 4x153x9x10x173
var desired = objects.last().attr('id').split('x')[1];
jsFiddle 演示