Uncaught TypeError: undefined is not a function javascript function

前端 未结 2 1386
旧时难觅i
旧时难觅i 2021-01-16 21:05

I wrote the \"bubble sort\" function to sort a list of images. I can\'t understand why the function returns the \"Uncaught TypeError: undefined is not a function\". Can anyo

2条回答
  •  清酒与你
    2021-01-16 21:47

    a[i].attr('src') = a[i+1].attr('src');
    

    has to be written:

    a[i].attr('src', a[i+1].attr('src'));
    

    Same for line below.

提交回复
热议问题