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...
Use visual studio code to write the javascript programme. For this lab you must use a...
Use visual studio code to write the javascript programme. For this lab you must use a reasonable faceted search example, each item must have at least three categorical attributes and at least one numeric attribute. Attributes such as ID, name etc do not count as categorical or numeric attributes. (a) Define a class for your item that meets the above three categorical and one numeric attribute requirements. (b) Create a text file that contains at least 5 such records in...
Use visual studio code to write the javascript programme. For this lab you must use a...
Use visual studio code to write the javascript programme. For this lab you must use a reasonable faceted search example, each item must have at least three categorical attributes and at least one numeric attribute. Attributes such as ID, name etc do not count as categorical or numeric attributes. (a) Define a class for your item that meets the above three categorical and one numeric attribute requirements. (b) Create a text file that contains at least 5 such records in...
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...
In HTML and Javacript: Create three columns. Column #1: Include input fields for the following... Text...
In HTML and Javacript: Create three columns. Column #1: Include input fields for the following... Text field (with labelling) to retrieve a student's FIRST name Text field (with labelling) to retrieve a student's last name Text field (with labelling) to retrieve a student's id (number) A checkbox for country designation with no check designating a "Domestic" student and checked designating an "International" student. A text field should be placed beside or under the check box with the text field containing...
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...
JavaScript Programming Assignment PLEASE NOTE:  You must create and call a main function, and if instructed include...
JavaScript Programming Assignment PLEASE NOTE:  You must create and call a main function, and if instructed include additional functions called by the main. Make sure to use ES6 style of keywords => instead of the older function and for local scope variables use the keyword let and not a keyword var. Make sure to follow the requirements and recheck before submitting. PROJECT GOAL: Write a program that is required to use nested loops to generate a triangle as shown in the...
*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...
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...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT