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.
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 :
Get Answers For Free
Most questions answered within 1 hours.