有什么理由为什么这不起作用?
var caseString = "sliderInput";
var theString = caseString.substring(1, 2);
我把它放在 Firefox 中的 Firebug 调试器中,它给了我错误:“无效的赋值左侧。”
* *这是我的确切代码
var elements = new Array();
elements = document.getElementsByTagName("Input");
var allSliderInputs = new Array();
var sliderParams = new Array();
var first, last, inc, style;
for (var i=0; i < elements.length ; i++){
var c = elements[i].className; //works fine here
var t = c.substring(0, 2); //when it hits this line it says "invalid assignment left-hand side"
}