Is there a simple way of comparing two arrays, then having an alert (or some other function later on) pop up if the arrays are equal, and one when it is not?
Here is my array
var answerKey = ["four", "two", "one", "three"];
var answers = [];
jQuery I have so far for this
$("#subBtn").click(function() {
$('#bin a').each(function() {
answers.push($(this).attr('name'));
})
console.log(answers);
});
HTML
<ul>
<li><a draggable="true" href="#" id="one" name="uno" class="imgHvr">One</a></li>
<li><a draggable="true" href="#" id="two" name="dos" class="imgHvr">2</a></li>
<li><a draggable="true" href="#" id="three" name="tres" class="imgHvr">three</a></li>
<li><a draggable="true" href="#" id="four" name="sweet" class="imgHvr">4</a></li>
</ul>