javascript with function parameter code example
Example 1: javascript function variable arguments
function foo() {
for (var i = 0; i < arguments.length; i++) {
console.log(arguments[i]);
}
}
foo(1,2,3);
Example 2: js running function as parameter
function FuncOne(param1)
{
}
function FuncTwo(FuncOne, param1)
{
FuncOne(param1);
}
Example 3: javascript function with input value
<button class="btn btn-primary" onclick="transmit({search: document.getElementById('search_id').value});">
<span class="glyphicon glyphicon-search"></span>
</button>