pTutorial

New way to learn Programming

JQuery function Example

JQuery : function

In this article I showed you on how to create and call function in Jquery. You can use following script to create and call the JQuery function.

JQuery function example

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="utf-8">

<title>JQuery Function example with button</title>

<script src="http://freeonlinecompiler.ptutorial.com/
js/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$.functionName = function(){ 
alert('Function has been called'); 
}
$(".uk").click(function(){
$.functionName();
});
});
</script> 

</head>

<body>

<button type="button" class="uk">Function Call</button>

</body>

</html>



Download

See Also


QUOTES OF THE DAY

Eat to live, and not live for eat.

LIKE ON FACEBOOK

+1 ON GOOGLE

SHARE ON TWITTER