One thing that is confusing me is the jQuery array object. To explain further: I have two arrays, one called brandsLink
and the other called floorLink
. When a user clicks on a link, I am saving the brand name in a variable called brandName
, and then checking if this variable exists in the second array. If it does, I will execute a different method. I have included an image for better understanding. The code snippet is shown below:
$('document').ready(function() {
var brandsLink = $('.brandLinks li a[id]');
var floorLink = $('#orionPlan .mapContainer area[id]');
brandsLink.click(function(e){
var brandName = this.id;
if(brandName == floorLink.find(brandName)){
console.log('yes both are matching.');
}
else {
console.log('sorry.');
}
});
});
Thank you, naresh kumar