jQuery isFunction() Method

Last Updated:

jQuery isFunction() Method

The jQuery isFunction() method determines if its argument is callable as a function.

Example

HTML Editor
<!DOCTYPE html> <html lang="en-US"> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> </head> <body> <h1>jQuery isFunction() Method</h1> <button>Click Me</button> <script> function myFunction(){ // dummy function } $(document).ready(function(){ $("button").click(function(){ alert($.isFunction(myFunction)); }); }); </script> </body> </html>

Syntax

$.isFunction(value);

Parameter Values

ValueTypeExplanation
value Required Specifies a value to be tested.

Browser Support

Devicedesktopmobile
Browsergoogle chromesafarifirefoxinternet Exploreredgeoperagoogle chromesafarifirefoxedgeoperaandroid webviewsamsung internet
isFunction()YesYesYesYesYesYesYesYesYesYesYesYesYes

Return Values

ValueExplanation
true The argument is a callable function.
false The argument is NOT a callable function.

Share this Page

Meet the Author