Check if inputs are empty using jQuery

And you don’t necessarily need .length or see if it’s >0 since an empty string evaluates to false anyway but if you’d like to for readability purposes: If you’re sure it will always operate on a textfield element then you can just use this.value. Also you should take note that $(‘input:text’) grabs multiple elements, specify … Read more

jQuery: Performing synchronous AJAX requests

As you’re making a synchronous request, that should be Example – http://api.jquery.com/jQuery.ajax/#example-3 PLEASE NOTE: Setting async property to false is deprecated and in the process of being removed (link). Many browsers including Firefox and Chrome have already started to print a warning in the console if you use this: Chrome: Synchronous XMLHttpRequest on the main … Read more

Highlight a word with jQuery

Try highlight: JavaScript text highlighting jQuery plugin. Warning: The source code available on this page contains a cryptocurrency mining script, either use the code below or remove the mining script from the script downloaded from the website. Also try the “updated” version of the original script.