I have some code like this, which is on a button click event.
var $this = $(this);
$this.closest('.opts').find("select").each(function() {
id = this.id;
if(this.value=="")
{
alert('Choose one');
return false;
}
console.log("#"+id);
console.log(this.value);
});
Why doesn’t the return false work here? Instead I am using prevent default.
Any suggestions will he highly appreciated!