Forum Moderators: open
var myString = "Hello World"; var myArr = myString.split(" "); // myArr[0] == "Hello" // myArr[1] == "World"
It's because it's not defined for the variable you are using it with. Check to make sure that it is a string you are working with.
function someFunc (element) { splitelement = element.split("-");
....
}