Search | View Active Threads | View New Posts
Current Time: 01:29 PM


+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2016

    Thumbs up How to Call a Function

    The calculateArea() function does nothing sitting on its own in the head of a document; it has to be called. In this example, you can call the function from a simple form using the onclick event, so that when the user clicks the Submit button the area will be calculated.

    <form name=”frmArea” action=””>
    Enter the width and height of your rectangle to calculate the size:<br />
    Width: <input type=”text” name=”txtWidth” size=”5” /><br />
    Height: <input type=”text” name=”txtHeight” size=”5” /><br />
    <input type=”button” value=”Calculate area”
    document.frmArea.txtHeight.value))” />

    Take a closer look at what is happening when the onclick event fires. First a JavaScript alert is being called, and then the calculateArea() function is being called inside the alert, so that the area is the value that is written to the alert box. Inside the parentheses where the calculateArea() function is being called, the two parameters being passed are the values of the width text box and the height text box using the dot notation you learned early in the section on the DOM.

  2. #2
    Join Date
    May 2019
    // function prototype, also called function declaration.
    void swap(int a, int b);
    int main()
    int m = 22, n = 44;
    // calling swap function by value.
    printf(" values before swap m = %d \nand n = %d", m, n);

  3. #3
    Join Date
    Sep 2018
    Use the keyword function followed by the name of the function. After the function name, open and close parentheses. Within curly braces, write your lines of code.

    Top Astrology Services in Canada | Indian Astrologer in Toronto | Best Indian Astrologer in Toronto | Indian Astrologer in Canada | Best Indian Astrologer in Canada | Astrologer in Canada

  4. #4

    MVNO Consulting

    var person = {
    lastName: "Doe",
    fullName: function () {
    return this.firstName + " " + this.lastName;
    person.fullName(); // Will return "John Doe"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts


Domain Escrow Services Domain Registrar, Marketplace and Revenue Optimizer
Trellian Direct Search Network

Industry Events

11-14 August 2019
Affiliate Summit East
New York, NY

4-6 March 2019
Las Vegas

15-18 September 2018
MERGE 2018
Orlando, FL


How do you invest in domains?
to see the Poll results!
Domain Tools | Domain Directory | Registrar Stats | Domain Glossary | Industry Events | FAQ | Members | Terms | RSS | Link To Us | Advertise | Contact Us
Other Related Trellian Services: Registrar  | Marketplace  | Domain Manager  |  Free Search Toolbar  |  Free Webpage Builder  |  Keyword Research
Direct Search Navigation  |  Search Engine Submission and SEO Tools
Copyright © 2002 a Trellian Company 2014 Bronze Sponsor - Internet Commerce Association