I just came across an issue in IE8, using the .split()
method.
element.name = 'question[10]';
var splitName = element.name.split(/\[([0-9]+)\]/);
// Split name just had 1 element,
// splitName[0] == 'question'
// In Chrome/Firefox it has 3
// splitName[0] == 'question'
// splitName[1] == '10'
// splitName[2] == ''
I've found a work around using this code, but I'm curious if this is a bug with IE8, or if this is expected, and there is a better way to achieve the same result without needing to modify the split method.