Hi ,can anyone tell me if we pass a function to another function as a parameter in javascript?

Yes.

<html>
<head>
<script>
    function add(a, b)
    {
        alert(a + b);
    }

    function takingFunction(x, y, func)
    {
        func(x, y);
    }
</script>
<head>
<body>
<form>
    <input type="submit" value="Submit" onclick="javascript:takingFunction(2, 3, add)" />
</form>
</body>
</html>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.