我有以下代码,这让我发疯:
$.each(originalSteps, function() {
if($(this).attr('id') == 'ps_attributes_step_'+(parseInt(triggered_step)+1))
{
alert('testing validity');
var newOne = $(this);
}
});
console.log(newOne)
现在,警报被触发,但 newOne 在循环外未定义。有什么解决办法吗?
谢谢