Question

Write in Javascript, create a Javascript "Todo" object with the following properties. And declare the two...

Write in Javascript, create a Javascript "Todo" object with the following properties. And declare the two functions/methods below as prototype functions for the object.

Todo

  • name
  • description
  • datetime
  • useremail

functions

  • getName()
  • getUserEmail()

Homework Answers

Answer #1

var TODO = {
name: 'John',
description: 'Hello world',
datetime: new Date(),
useremail:'[email protected]'
}
function getUserEmail(){
return TODO.useremail;
}
function getName(){
return TODO.name;
}

Full code

<!DOCTYPE html>
<html>
<body>

<h2>JavaScript Objects</h2>

<p id="demo"></p>

<script>
var TODO = {
name: 'John',
description: 'Hello world',
datetime: new Date(),
useremail:'[email protected]'
}
function getUserEmail(){
return TODO.useremail;
}
function getName(){
return TODO.name;
}
document.getElementById("demo").innerHTML = getName();
document.getElementById("demo").innerHTML += getUserEmail();
</script>

</body>
</html>

 

 
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
Create a Survey Object with 3 Properties. Name, Description, Question array Create a form that can...
Create a Survey Object with 3 Properties. Name, Description, Question array Create a form that can populate those properties for the survey and use the question form to create 3 questions. Create the Survey object with functions as well. You will need to populate this object with the above properties like a copy constructor. Concepts to use are JSON, and local storage.
Write the below code to use HTML and JavaScript. 1)Write a JavaScript program to create a...
Write the below code to use HTML and JavaScript. 1)Write a JavaScript program to create a new string from a given string changing the position of first and last characters. The string length must be greater than or equal to 1. 2)Write a JavaScript program to check whether a string starts with 'Java' and false otherwise
Instructions: SLLStack (12 pts) ● Using the two properties below, implement the stack interface using the...
Instructions: SLLStack (12 pts) ● Using the two properties below, implement the stack interface using the SLLNode class from Lab 2: ○ top_node → SLLNode object or None ○ size → int, keep track of stack size ● Implement the push( ), pop( ), top( ) methods ● Use SLLNode methods: get_item( ), set_item( ), get_next( ), set_next( ) ● (5 pts) In push(item): ○ Create new SLLNode with item ○ Add new node before top node ○ Update top_node...
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...
Write the program in java Implement a class Product. Create instance variables to store product name...
Write the program in java Implement a class Product. Create instance variables to store product name and price and supply the values through constructor. For example new Product(“Toaster’, 29.95). Create methods, getName, getPrice. Write a method productPrinter that prints the product name and its price after reducing it by $5. Create a main class and necessary constructs in the main class to run the Product class.
(Please use java to write these questions) Q1. Create a class on an object Computer with...
(Please use java to write these questions) Q1. Create a class on an object Computer with two fields and two methods as follows: (5 points) field: cpu and memory, method: compile( ) and execute( ) Q2. Write a source code to activate a class created in Q1. (5 points)
javascript 1.Write a function delay that accepts two arguments, a callback and the wait time in...
javascript 1.Write a function delay that accepts two arguments, a callback and the wait time in milliseconds. Delay should return a function that, when invoked waits for the specified amount of time before executing. HINT - research setTimeout(); 2.Create a function saveOutput that accepts a function (that will accept one argument), and a string (that will act as a password). saveOutput will then return a function that behaves exactly like the passed-in function, except for when the password string is...
Write a program in Python to declare two empty lists one is for name and one...
Write a program in Python to declare two empty lists one is for name and one for salaries. Within the for loop ask for employees name and their salaries and append them into the list accordingly. Find out the total salary using accumulation concept within the for loop. Output : Both of the lists with their items and the total salary.
Create a new project in BlueJ. Create two new classes in the project, with the following...
Create a new project in BlueJ. Create two new classes in the project, with the following specifications: Class name: Runner Fields: bibId (int) event (String) age (int) 1 Constructor: takes parameters runnerBibId, raceEvent, and runnerRaceDayAge as parameters to initialize fields Methods: Write get-methods (getters) for all three fields. The getters should be named getBibId, getEvent, and getAge. Save the project as a jar file to submit.
Please use javascript. Square Class Create a square class defined by the following Property side Methods...
Please use javascript. Square Class Create a square class defined by the following Property side Methods perimeter (side times 4) area (side squared) diagonal (square root of 2 * side squared) describe – shows the squares information as follows: Square with side 2 has perimeter of 8, area of 4, and diagonal of 2.828 Your program is to create three squares and use the describe method to show each squares information.
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT