Question

Please Use Javascript and HTML 1) Greeter Create an page with an input, and a button....

Please Use Javascript and HTML

1) Greeter

Create an page with an input, and a button. When the button is clicked, output the phrase "Hello {Name}" to the developer console, with {Name} being the value the user put into the input field.

Use a function that takes the name as an argument, and returns the full phrase as its output.

Homework Answers

Answer #1

HTML Page :

<!DOCTYPE html>

<html lang="en">

    <head>

        <!-- This is title for web page -->

        <title>Greeter</title>

        <meta charset="UTF-8">

        <meta name="viewport" content="width=device-width, initial-scale=1">

       

    </head>

    <body>

    <!-- textbox to enter name -->

    <input

        type="text"

        id="textboxName"

        placeholder="Enter Name"/>

    <br><br>

    <!-- button -->

    <input type="button" value="Greet User" onclick="greet()"/>

    <!-- <Script> tag is used for javascript -->

        <script>

            //function greet

            function greet()

            {

                //taking name entered by user

                var name=document.getElementById("textboxName").value;

                //call a function and display name

                console.log(displayName(name));

            }

            //function displayName()

            function displayName(name)

            {

                return "Hello "+name;//concate the name and returm

            }

        </script>

    </body>

</html>

====================================

Screenn showing textbox and button :

Screen showing name on the console :

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Please Use JavaScript and P5 3) Password Protected Create an application with two input fields and...
Please Use JavaScript and P5 3) Password Protected Create an application with two input fields and one button. When the button is clicked, verify the user has written these (exact) strings in the first and second field: First field should be "Username" Second field should be "Password" If the two fields match, update a DIV on the page with the text "Success" or else "Wrong information". For this assignment: use only one if statement to to the check. Remember you'll...
Please linked both files. For this assignment you need to create a ToDo list using Javascript,...
Please linked both files. For this assignment you need to create a ToDo list using Javascript, along with HTML and CSS. Begin by creating a HTML page called todo.html. Then create a Javascript file called todo.js and link it in to the HTML page using a script tag. All Javascript for the assignment must be in the separate file. (For CSS, feel free to include styles in a style block at the top of the HTML page, or to link...
For this assignment, create an html page that has a login form. The form should have...
For this assignment, create an html page that has a login form. The form should have 3 input elements -- 1. This should have a type text for the user to enter UserName 2. This should have a type password (like text except cannot see the text that is typed in), for the user to enter password. 3. Submit button (type submit, as we did in class on 2/6). The form method should be set to POST and the action...
*To the guy who answered last time. You're not following the directions. Please follow specific directions...
*To the guy who answered last time. You're not following the directions. Please follow specific directions below.* Create a "web page" with the following components: An input field for the "number of rounds to play" The "number of remaining" rounds should also be displayed somewhere on the screen. A button to "Start" the game play. The function attached to this button can "setup" the rest of the game. For example: initialize counters, show/hide other components, etc. A set of buttons...
Questions: 1. (5 marks) Create a VB.NET Console Application that defines a function Smallest and calls...
Questions: 1. Create a VB.NET Console Application that defines a function Smallest and calls this function from the main program. The function Smallest takes three parameters, all of the Integer data type, and returns the value of the smallest among the three parameters. The main program should (1) Prompt a message (using Console.WriteLine) to ask the user to input three integers. (2) Call the built-in function Console.ReadLine() three times to get the user’s input. (3) Convert the user’s input from...
This will be my third time submitting this question. THERE SHOULD BE NO USE OF CSS...
This will be my third time submitting this question. THERE SHOULD BE NO USE OF CSS OR SWITCH STATEMENTS IN THE JAVASCRIPT. Even though there is stylesheet in the HTML file do no create a new one. Project Standards: Students will use click events to capture user input. Students will use variables to store information needed by their application and keep track of their program’s state. Students will use conditionals to control project flow. Project Task You will be building...
You must use Windows Programming(Do NOT use Console) to complete this assignment. Use any C# method...
You must use Windows Programming(Do NOT use Console) to complete this assignment. Use any C# method you already know. Create a Windows application that function like a banking account register. Separate the business logic from the presentation layer. The graphical user interface should allow user to input the account name, number, and balance. Provide TextBox objects for withdrawals and deposits. A button object should be available for clicking to process withdrawal and deposit transactions showing the new balance. Document and...
Using C programming Create a function called printMenu( ) with the following properties: Has no function...
Using C programming Create a function called printMenu( ) with the following properties: Has no function inputs or output. Prints the following menu to the screen: 1. Enter user name. 2. Enter scores. 3. Display average score. 4. Display summary. 5. Quit Create a function called printLine( ) with the following properties: Takes as input a char Takes as input an integer corresponding to the number of times to print the character Has no function output. For example, if we...
Need this done using PHP code and not javascript Create a PHP form with a textarea...
Need this done using PHP code and not javascript Create a PHP form with a textarea field input and a submit button. The textarea field should be able to accept up to 250 characters. When the user clicks the Submit button, read the text in the textarea and display the following results on a web age. At the bottom of the page include a link back to the form. Number of characters: Number of words: (hint: explode the string into...
C# Step 1: Create a Windows Forms Application. Step 2: Create a BankAccount class. Include: Private...
C# Step 1: Create a Windows Forms Application. Step 2: Create a BankAccount class. Include: Private data fields to store the account holder's name and the account balance A constructor with 0 arguments A constructor with 1 argument (account holder's name) A constructor with 2 arguments(account holder's name and account balance) Public properties for the account holder's name and the account balance. Do not use auto-implemented properties. A method to increase the balance (deposit) A method to decrease the balance...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT