Encountered an issue with IE8 when using the .split()
method.
element.name = 'question[10]';
var splitName = element.name.split(/\[([0-9]+)\]/);
// The split name array only contains one element in IE8,
// splitName[0] == 'question'
// Whereas in Chrome/Firefox it has three elements
// splitName[0] == 'question'
// splitName[1] == '10'
// splitName[2] == ''
Managed to find a solution by utilizing this code snippet. However, I am curious to know if this behavior is a bug specific to IE8 or if it is expected. Is there a better approach to achieving the same outcome without having to modify the split method?