How can I write a jQuery condition that stops code execution if the value is empty? Language Notes JavaScript
You can use the conditional statement if to make a judgment. If the value of a variable or expression is empty, use the return keyword to terminate the execution of the function. For example: function myFunction() { var myVar = $('#myInput').val(); if (!myVar) { // If the value of myVar is empty, use ! …