There are two arrays that need to be compared.
var arr1 = document.querySelectorAll('#items p'); //Первый массив var arr2 = [1,2,3,4,5] //Второй массив <ul id="items"> <li><p>1</p></li> <li><p>2</p></li> <li><p>3</p></li> <li><p>4</p></li> <li><p>5</p></li> </ul> It is necessary to check whether the values of the paragraphs coincide with the array, it is impossible to pull out the value of p, so I can not compare.
I entered the same values for the example, the values are substituted all the time different.