Javascript examples for jQuery Method and Property:click
Adding function parameters using a single variable in jQuery
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-1.6.js"></script> <script type="text/javascript"> $(function(){//w ww . jav a2 s . c o m function Func (a,b){ console.log(a+' | '+b); } var Parameters = 'abc,123'; var Function = Func; $('button').click(function() { Func.apply(null, Parameters.split(",")); }); }); </script> </head> <body> <button>Cool</button> </body> </html>