SlideShare a Scribd company logo
1 of 4
Download to read offline
I need to have the HTML separated from the Javascript. Also, I am visually-impaired, so please
do not upload an image, because I can’t see it; and the screen reader won’t read it to me. Please
write simple code, so that I can try to follow it. In Javascript, using JSFiddle, we are going to
create a Doubly Linked List. The List will be made up of Nodes. Each node will have the
following properties; Node Properties id - A simple id for the node itself, content - A value
(String) next - A pointer to the next node in the List (null for the last node). last - A pointer to the
previous node in the List List Properties head - Pointer to the first node in the list length -
Number of nodes in the list Next - you will populate your list with 5 nodes with content A, B, C,
D, E. You will also create a print function for the list that will print the nodes in order. You will
need to create some functions to support this functionality. You will now need to write an
interface to allow the user to add nodes to the end of the list. There should be a single text box to
enter the Node content, and a button "Add to List". When the user adds a node to the list, then
you should add the node with the content to the end of the list and print the new list. I need to
have the HTML separated from the Javascript. Also, I am visually-impaired, so please do not
upload an image, because I can’t see it; and the screen reader won’t read it to me. Please write
simple code, so that I can try to follow it. In Javascript, using JSFiddle, we are going to create a
Doubly Linked List. The List will be made up of Nodes. Each node will have the following
properties; Node Properties id - A simple id for the node itself, content - A value (String) next -
A pointer to the next node in the List (null for the last node). last - A pointer to the previous node
in the List List Properties head - Pointer to the first node in the list length - Number of nodes in
the list Next - you will populate your list with 5 nodes with content A, B, C, D, E. You will also
create a print function for the list that will print the nodes in order. You will need to create some
functions to support this functionality. You will now need to write an interface to allow the user
to add nodes to the end of the list. There should be a single text box to enter the Node content,
and a button "Add to List". When the user adds a node to the list, then you should add the node
with the content to the end of the list and print the new list.
Solution
var list = null;
//a function for creating a list
function createList() {
var value = document.getElementById("LinkName").value;
var length = document.getElementById("LinkName").length;
list = new List(value,length);
document.getElementById("demo").innerHTML = list.print();
}
//a function for adding a new node to list
function addNode() {
var id = document.getElementById("LinkName").id;
var value = document.getElementById("LinkName").value;
list.addNode(id,value);
document.getElementById("demo").innerHTML = list.print();
}
// Define the link object with following properties
function Node(_id,_value, _last) {
this.id=_id;// A simple id for the node itself
this.value = _value; // The value stored
this.last = _last; // A pointer to the previous link
this.next = null; // a pointer to the next link
return this; // returns the created node
}
Node.prototype.asString = function() {
return "Node Value:" + this.value + "
";
}
// Define the List object
function List(_value,_length) {
// We will define the list with the first link defined
this.length = _length;
this.head = new Node(_id,_value, null); // Pointer TO the head is null
this.last = this.head; // When created - head and last are the same.
}
List.prototype.addNode = function(_value) {
var node = new Node(_id,_value, _last);
if (this._length) {
this.last.next = node;
node.last = this.last;
this.last = node;
} else {
this.head = node;
this.last = node;
}
this._length++;
return node;
}
//print function
List.prototype.print = function()
{
var s = "";
var n = this.head;
while (n != null){
s += n.asString();
n = n.next;
}
return s;
}
//create data structure object
var _list= new createList();
//add nodes
var node = new Node(_id,_value, _last);
node.id = 1;
node.value = "A";
_list.addNode(node);
var node = new Node(_id,_value, _last);
node.id = 2;
node.value = "B";
_list.addNode(node);
var node = new Node(_id,_value, _last);
node.id = 3;
node.value = "C";
_list.addNode(node);
var node = new Node(_id,_value, _last);
node.id = 4;
node.value = "D";
_list.addNode(node);
var node = new Node(_id,_value, _last);
node.id = 5;
node.value = "E";
_list.addNode(node);
_list.print();

More Related Content

Similar to I need to have the HTML separated from the Javascript. Also, I am vi.pdf

Seo Expert course in Pakistan
Seo Expert course in PakistanSeo Expert course in Pakistan
Seo Expert course in Pakistanssuserb2c86f
 
Need done for Date Structures please! 4-18 LAB- Sorted number list imp.pdf
Need done for Date Structures please! 4-18 LAB- Sorted number list imp.pdfNeed done for Date Structures please! 4-18 LAB- Sorted number list imp.pdf
Need done for Date Structures please! 4-18 LAB- Sorted number list imp.pdfinfo114
 
C++ Please test your program before you submit the answer.pdf
C++ Please test your program before you submit the answer.pdfC++ Please test your program before you submit the answer.pdf
C++ Please test your program before you submit the answer.pdfaashisha5
 
In this lab we will write code for working with a Linked List. Node .pdf
In this lab we will write code for working with a Linked List.  Node .pdfIn this lab we will write code for working with a Linked List.  Node .pdf
In this lab we will write code for working with a Linked List. Node .pdffms12345
 
JavaScript Workshop
JavaScript WorkshopJavaScript Workshop
JavaScript WorkshopPamela Fox
 
Please solve the following problem using C++- Thank you Instructions-.docx
Please solve the following problem using C++- Thank you Instructions-.docxPlease solve the following problem using C++- Thank you Instructions-.docx
Please solve the following problem using C++- Thank you Instructions-.docxPeterlqELawrenceb
 
C++ Doubly-Linked ListsThe goal of the exercise is to implement a.pdf
C++ Doubly-Linked ListsThe goal of the exercise is to implement a.pdfC++ Doubly-Linked ListsThe goal of the exercise is to implement a.pdf
C++ Doubly-Linked ListsThe goal of the exercise is to implement a.pdfpoblettesedanoree498
 
Write a Java Class to Implement a Generic Linked ListYour list mus.pdf
Write a Java Class to Implement a Generic Linked ListYour list mus.pdfWrite a Java Class to Implement a Generic Linked ListYour list mus.pdf
Write a Java Class to Implement a Generic Linked ListYour list mus.pdfrozakashif85
 
C++ please put everthing after you answer it- thanks Complete the stub.docx
C++ please put everthing after you answer it- thanks Complete the stub.docxC++ please put everthing after you answer it- thanks Complete the stub.docx
C++ please put everthing after you answer it- thanks Complete the stub.docxMatthPYNashd
 
Assignment isPage 349-350 #4 and #5 Use the Linked List lab.pdf
Assignment isPage 349-350 #4 and #5 Use the Linked List lab.pdfAssignment isPage 349-350 #4 and #5 Use the Linked List lab.pdf
Assignment isPage 349-350 #4 and #5 Use the Linked List lab.pdffortmdu
 
in C++ , Design a linked list class named IntegerList to hold a seri.pdf
in C++ , Design a linked list class named IntegerList to hold a seri.pdfin C++ , Design a linked list class named IntegerList to hold a seri.pdf
in C++ , Design a linked list class named IntegerList to hold a seri.pdfeyewaregallery
 
hello- please dont just copy from other answers- the following is the.docx
hello- please dont just copy from other answers- the following is the.docxhello- please dont just copy from other answers- the following is the.docx
hello- please dont just copy from other answers- the following is the.docxIsaac9LjWelchq
 
Wk11-linkedlist.ppt
Wk11-linkedlist.pptWk11-linkedlist.ppt
Wk11-linkedlist.pptMrsSHEEBAM
 
Assg 07 Templates and Operator OverloadingCOSC 2336 Sprin.docx
Assg 07 Templates and Operator OverloadingCOSC 2336 Sprin.docxAssg 07 Templates and Operator OverloadingCOSC 2336 Sprin.docx
Assg 07 Templates and Operator OverloadingCOSC 2336 Sprin.docxfestockton
 

Similar to I need to have the HTML separated from the Javascript. Also, I am vi.pdf (20)

Seo Expert course in Pakistan
Seo Expert course in PakistanSeo Expert course in Pakistan
Seo Expert course in Pakistan
 
Need done for Date Structures please! 4-18 LAB- Sorted number list imp.pdf
Need done for Date Structures please! 4-18 LAB- Sorted number list imp.pdfNeed done for Date Structures please! 4-18 LAB- Sorted number list imp.pdf
Need done for Date Structures please! 4-18 LAB- Sorted number list imp.pdf
 
C++ Please test your program before you submit the answer.pdf
C++ Please test your program before you submit the answer.pdfC++ Please test your program before you submit the answer.pdf
C++ Please test your program before you submit the answer.pdf
 
Data structure
 Data structure Data structure
Data structure
 
In this lab we will write code for working with a Linked List. Node .pdf
In this lab we will write code for working with a Linked List.  Node .pdfIn this lab we will write code for working with a Linked List.  Node .pdf
In this lab we will write code for working with a Linked List. Node .pdf
 
JavaScript Workshop
JavaScript WorkshopJavaScript Workshop
JavaScript Workshop
 
Please solve the following problem using C++- Thank you Instructions-.docx
Please solve the following problem using C++- Thank you Instructions-.docxPlease solve the following problem using C++- Thank you Instructions-.docx
Please solve the following problem using C++- Thank you Instructions-.docx
 
C++ Doubly-Linked ListsThe goal of the exercise is to implement a.pdf
C++ Doubly-Linked ListsThe goal of the exercise is to implement a.pdfC++ Doubly-Linked ListsThe goal of the exercise is to implement a.pdf
C++ Doubly-Linked ListsThe goal of the exercise is to implement a.pdf
 
Write a Java Class to Implement a Generic Linked ListYour list mus.pdf
Write a Java Class to Implement a Generic Linked ListYour list mus.pdfWrite a Java Class to Implement a Generic Linked ListYour list mus.pdf
Write a Java Class to Implement a Generic Linked ListYour list mus.pdf
 
C++ please put everthing after you answer it- thanks Complete the stub.docx
C++ please put everthing after you answer it- thanks Complete the stub.docxC++ please put everthing after you answer it- thanks Complete the stub.docx
C++ please put everthing after you answer it- thanks Complete the stub.docx
 
Linked List
Linked ListLinked List
Linked List
 
Assignment isPage 349-350 #4 and #5 Use the Linked List lab.pdf
Assignment isPage 349-350 #4 and #5 Use the Linked List lab.pdfAssignment isPage 349-350 #4 and #5 Use the Linked List lab.pdf
Assignment isPage 349-350 #4 and #5 Use the Linked List lab.pdf
 
in C++ , Design a linked list class named IntegerList to hold a seri.pdf
in C++ , Design a linked list class named IntegerList to hold a seri.pdfin C++ , Design a linked list class named IntegerList to hold a seri.pdf
in C++ , Design a linked list class named IntegerList to hold a seri.pdf
 
Amusing C#
Amusing C#Amusing C#
Amusing C#
 
hello- please dont just copy from other answers- the following is the.docx
hello- please dont just copy from other answers- the following is the.docxhello- please dont just copy from other answers- the following is the.docx
hello- please dont just copy from other answers- the following is the.docx
 
linkedlist.ppt
linkedlist.pptlinkedlist.ppt
linkedlist.ppt
 
Wk11-linkedlist.ppt
Wk11-linkedlist.pptWk11-linkedlist.ppt
Wk11-linkedlist.ppt
 
Wk11-linkedlist.ppt
Wk11-linkedlist.pptWk11-linkedlist.ppt
Wk11-linkedlist.ppt
 
Assg 07 Templates and Operator OverloadingCOSC 2336 Sprin.docx
Assg 07 Templates and Operator OverloadingCOSC 2336 Sprin.docxAssg 07 Templates and Operator OverloadingCOSC 2336 Sprin.docx
Assg 07 Templates and Operator OverloadingCOSC 2336 Sprin.docx
 
C Exam Help
C Exam Help C Exam Help
C Exam Help
 

More from FOREVERPRODUCTCHD

You are asked with writing a program in C that manages contact infor.pdf
You are asked with writing a program in C that manages contact infor.pdfYou are asked with writing a program in C that manages contact infor.pdf
You are asked with writing a program in C that manages contact infor.pdfFOREVERPRODUCTCHD
 
Write a short paragraph explaining what the exploit does in Assembly.pdf
Write a short paragraph explaining what the exploit does in Assembly.pdfWrite a short paragraph explaining what the exploit does in Assembly.pdf
Write a short paragraph explaining what the exploit does in Assembly.pdfFOREVERPRODUCTCHD
 
Write a program to convert a given INFIX into POSTFIX. Make sure .pdf
Write a program to convert a given INFIX into POSTFIX. Make sure .pdfWrite a program to convert a given INFIX into POSTFIX. Make sure .pdf
Write a program to convert a given INFIX into POSTFIX. Make sure .pdfFOREVERPRODUCTCHD
 
What quality control mechanisms should major accounting firms have i.pdf
What quality control mechanisms should major accounting firms have i.pdfWhat quality control mechanisms should major accounting firms have i.pdf
What quality control mechanisms should major accounting firms have i.pdfFOREVERPRODUCTCHD
 
What are three basic ethical principles for journalism Why are ethi.pdf
What are three basic ethical principles for journalism Why are ethi.pdfWhat are three basic ethical principles for journalism Why are ethi.pdf
What are three basic ethical principles for journalism Why are ethi.pdfFOREVERPRODUCTCHD
 
What are some of the different versions of UNIX® Why is it importan.pdf
What are some of the different versions of UNIX® Why is it importan.pdfWhat are some of the different versions of UNIX® Why is it importan.pdf
What are some of the different versions of UNIX® Why is it importan.pdfFOREVERPRODUCTCHD
 
Type in your own words In details, discuss the following questions.pdf
Type in your own words In details, discuss the following questions.pdfType in your own words In details, discuss the following questions.pdf
Type in your own words In details, discuss the following questions.pdfFOREVERPRODUCTCHD
 
Twice a first number decreased by a second number is 11. The first nu.pdf
Twice a first number decreased by a second number is 11. The first nu.pdfTwice a first number decreased by a second number is 11. The first nu.pdf
Twice a first number decreased by a second number is 11. The first nu.pdfFOREVERPRODUCTCHD
 
the largest drum ever constructed was played at the Rotal festival H.pdf
the largest drum ever constructed was played at the Rotal festival H.pdfthe largest drum ever constructed was played at the Rotal festival H.pdf
the largest drum ever constructed was played at the Rotal festival H.pdfFOREVERPRODUCTCHD
 
Suppose that the material that you are recrystallizing fails to perc.pdf
Suppose that the material that you are recrystallizing fails to perc.pdfSuppose that the material that you are recrystallizing fails to perc.pdf
Suppose that the material that you are recrystallizing fails to perc.pdfFOREVERPRODUCTCHD
 
Summarize the purpose of a WAN and define what makes up a WAN connec.pdf
Summarize the purpose of a WAN and define what makes up a WAN connec.pdfSummarize the purpose of a WAN and define what makes up a WAN connec.pdf
Summarize the purpose of a WAN and define what makes up a WAN connec.pdfFOREVERPRODUCTCHD
 
SOS Please please please help on this problem!!!!!!!!!!!!!!!!!!!!!! .pdf
SOS Please please please help on this problem!!!!!!!!!!!!!!!!!!!!!! .pdfSOS Please please please help on this problem!!!!!!!!!!!!!!!!!!!!!! .pdf
SOS Please please please help on this problem!!!!!!!!!!!!!!!!!!!!!! .pdfFOREVERPRODUCTCHD
 
Step 12 The task is complete when the quota can be verified. Take a.pdf
Step 12  The task is complete when the quota can be verified.  Take a.pdfStep 12  The task is complete when the quota can be verified.  Take a.pdf
Step 12 The task is complete when the quota can be verified. Take a.pdfFOREVERPRODUCTCHD
 
QUESTIONDiscuss how has Web 2.0 changed the behavior of Internet .pdf
QUESTIONDiscuss how has Web 2.0 changed the behavior of Internet .pdfQUESTIONDiscuss how has Web 2.0 changed the behavior of Internet .pdf
QUESTIONDiscuss how has Web 2.0 changed the behavior of Internet .pdfFOREVERPRODUCTCHD
 
Python program with functions that extracts specific characters from.pdf
Python program with functions that extracts specific characters from.pdfPython program with functions that extracts specific characters from.pdf
Python program with functions that extracts specific characters from.pdfFOREVERPRODUCTCHD
 
Please answer the following question and all its parts. Please exp.pdf
Please answer the following question and all its parts. Please exp.pdfPlease answer the following question and all its parts. Please exp.pdf
Please answer the following question and all its parts. Please exp.pdfFOREVERPRODUCTCHD
 
Please help, I cant figure out what I did wrong. Problem 11-2A (Pa.pdf
Please help, I cant figure out what I did wrong. Problem 11-2A (Pa.pdfPlease help, I cant figure out what I did wrong. Problem 11-2A (Pa.pdf
Please help, I cant figure out what I did wrong. Problem 11-2A (Pa.pdfFOREVERPRODUCTCHD
 
Know the different types of viruses which have a dsRNA genome A type.pdf
Know the different types of viruses which have a dsRNA genome  A type.pdfKnow the different types of viruses which have a dsRNA genome  A type.pdf
Know the different types of viruses which have a dsRNA genome A type.pdfFOREVERPRODUCTCHD
 
In what ways do the experts foresee the use of both virtualization a.pdf
In what ways do the experts foresee the use of both virtualization a.pdfIn what ways do the experts foresee the use of both virtualization a.pdf
In what ways do the experts foresee the use of both virtualization a.pdfFOREVERPRODUCTCHD
 
In the Meselson Stahl experiment, E. coli was grown for many generati.pdf
In the Meselson Stahl experiment, E. coli was grown for many generati.pdfIn the Meselson Stahl experiment, E. coli was grown for many generati.pdf
In the Meselson Stahl experiment, E. coli was grown for many generati.pdfFOREVERPRODUCTCHD
 

More from FOREVERPRODUCTCHD (20)

You are asked with writing a program in C that manages contact infor.pdf
You are asked with writing a program in C that manages contact infor.pdfYou are asked with writing a program in C that manages contact infor.pdf
You are asked with writing a program in C that manages contact infor.pdf
 
Write a short paragraph explaining what the exploit does in Assembly.pdf
Write a short paragraph explaining what the exploit does in Assembly.pdfWrite a short paragraph explaining what the exploit does in Assembly.pdf
Write a short paragraph explaining what the exploit does in Assembly.pdf
 
Write a program to convert a given INFIX into POSTFIX. Make sure .pdf
Write a program to convert a given INFIX into POSTFIX. Make sure .pdfWrite a program to convert a given INFIX into POSTFIX. Make sure .pdf
Write a program to convert a given INFIX into POSTFIX. Make sure .pdf
 
What quality control mechanisms should major accounting firms have i.pdf
What quality control mechanisms should major accounting firms have i.pdfWhat quality control mechanisms should major accounting firms have i.pdf
What quality control mechanisms should major accounting firms have i.pdf
 
What are three basic ethical principles for journalism Why are ethi.pdf
What are three basic ethical principles for journalism Why are ethi.pdfWhat are three basic ethical principles for journalism Why are ethi.pdf
What are three basic ethical principles for journalism Why are ethi.pdf
 
What are some of the different versions of UNIX® Why is it importan.pdf
What are some of the different versions of UNIX® Why is it importan.pdfWhat are some of the different versions of UNIX® Why is it importan.pdf
What are some of the different versions of UNIX® Why is it importan.pdf
 
Type in your own words In details, discuss the following questions.pdf
Type in your own words In details, discuss the following questions.pdfType in your own words In details, discuss the following questions.pdf
Type in your own words In details, discuss the following questions.pdf
 
Twice a first number decreased by a second number is 11. The first nu.pdf
Twice a first number decreased by a second number is 11. The first nu.pdfTwice a first number decreased by a second number is 11. The first nu.pdf
Twice a first number decreased by a second number is 11. The first nu.pdf
 
the largest drum ever constructed was played at the Rotal festival H.pdf
the largest drum ever constructed was played at the Rotal festival H.pdfthe largest drum ever constructed was played at the Rotal festival H.pdf
the largest drum ever constructed was played at the Rotal festival H.pdf
 
Suppose that the material that you are recrystallizing fails to perc.pdf
Suppose that the material that you are recrystallizing fails to perc.pdfSuppose that the material that you are recrystallizing fails to perc.pdf
Suppose that the material that you are recrystallizing fails to perc.pdf
 
Summarize the purpose of a WAN and define what makes up a WAN connec.pdf
Summarize the purpose of a WAN and define what makes up a WAN connec.pdfSummarize the purpose of a WAN and define what makes up a WAN connec.pdf
Summarize the purpose of a WAN and define what makes up a WAN connec.pdf
 
SOS Please please please help on this problem!!!!!!!!!!!!!!!!!!!!!! .pdf
SOS Please please please help on this problem!!!!!!!!!!!!!!!!!!!!!! .pdfSOS Please please please help on this problem!!!!!!!!!!!!!!!!!!!!!! .pdf
SOS Please please please help on this problem!!!!!!!!!!!!!!!!!!!!!! .pdf
 
Step 12 The task is complete when the quota can be verified. Take a.pdf
Step 12  The task is complete when the quota can be verified.  Take a.pdfStep 12  The task is complete when the quota can be verified.  Take a.pdf
Step 12 The task is complete when the quota can be verified. Take a.pdf
 
QUESTIONDiscuss how has Web 2.0 changed the behavior of Internet .pdf
QUESTIONDiscuss how has Web 2.0 changed the behavior of Internet .pdfQUESTIONDiscuss how has Web 2.0 changed the behavior of Internet .pdf
QUESTIONDiscuss how has Web 2.0 changed the behavior of Internet .pdf
 
Python program with functions that extracts specific characters from.pdf
Python program with functions that extracts specific characters from.pdfPython program with functions that extracts specific characters from.pdf
Python program with functions that extracts specific characters from.pdf
 
Please answer the following question and all its parts. Please exp.pdf
Please answer the following question and all its parts. Please exp.pdfPlease answer the following question and all its parts. Please exp.pdf
Please answer the following question and all its parts. Please exp.pdf
 
Please help, I cant figure out what I did wrong. Problem 11-2A (Pa.pdf
Please help, I cant figure out what I did wrong. Problem 11-2A (Pa.pdfPlease help, I cant figure out what I did wrong. Problem 11-2A (Pa.pdf
Please help, I cant figure out what I did wrong. Problem 11-2A (Pa.pdf
 
Know the different types of viruses which have a dsRNA genome A type.pdf
Know the different types of viruses which have a dsRNA genome  A type.pdfKnow the different types of viruses which have a dsRNA genome  A type.pdf
Know the different types of viruses which have a dsRNA genome A type.pdf
 
In what ways do the experts foresee the use of both virtualization a.pdf
In what ways do the experts foresee the use of both virtualization a.pdfIn what ways do the experts foresee the use of both virtualization a.pdf
In what ways do the experts foresee the use of both virtualization a.pdf
 
In the Meselson Stahl experiment, E. coli was grown for many generati.pdf
In the Meselson Stahl experiment, E. coli was grown for many generati.pdfIn the Meselson Stahl experiment, E. coli was grown for many generati.pdf
In the Meselson Stahl experiment, E. coli was grown for many generati.pdf
 

Recently uploaded

Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinhĐề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinhleson0603
 
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...Nguyen Thanh Tu Collection
 
Observing-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxObserving-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxAdelaideRefugio
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽中 央社
 
How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17Celine George
 
demyelinated disorder: multiple sclerosis.pptx
demyelinated disorder: multiple sclerosis.pptxdemyelinated disorder: multiple sclerosis.pptx
demyelinated disorder: multiple sclerosis.pptxMohamed Rizk Khodair
 
Improved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppImproved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppCeline George
 
PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxMarlene Maheu
 
Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxneillewis46
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismDabee Kamal
 
Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...EduSkills OECD
 
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportBasic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportDenish Jangid
 
The Liver & Gallbladder (Anatomy & Physiology).pptx
The Liver &  Gallbladder (Anatomy & Physiology).pptxThe Liver &  Gallbladder (Anatomy & Physiology).pptx
The Liver & Gallbladder (Anatomy & Physiology).pptxVishal Singh
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....Ritu480198
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnershipsexpandedwebsite
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...EADTU
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxCeline George
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjMohammed Sikander
 
Climbers and Creepers used in landscaping
Climbers and Creepers used in landscapingClimbers and Creepers used in landscaping
Climbers and Creepers used in landscapingDr. M. Kumaresan Hort.
 

Recently uploaded (20)

Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinhĐề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
 
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
 
Observing-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxObserving-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptx
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
 
How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17
 
demyelinated disorder: multiple sclerosis.pptx
demyelinated disorder: multiple sclerosis.pptxdemyelinated disorder: multiple sclerosis.pptx
demyelinated disorder: multiple sclerosis.pptx
 
Improved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppImproved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio App
 
PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptx
 
Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptx
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in Hinduism
 
Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...
 
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportBasic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
 
The Liver & Gallbladder (Anatomy & Physiology).pptx
The Liver &  Gallbladder (Anatomy & Physiology).pptxThe Liver &  Gallbladder (Anatomy & Physiology).pptx
The Liver & Gallbladder (Anatomy & Physiology).pptx
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptx
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
 
Climbers and Creepers used in landscaping
Climbers and Creepers used in landscapingClimbers and Creepers used in landscaping
Climbers and Creepers used in landscaping
 

I need to have the HTML separated from the Javascript. Also, I am vi.pdf

  • 1. I need to have the HTML separated from the Javascript. Also, I am visually-impaired, so please do not upload an image, because I can’t see it; and the screen reader won’t read it to me. Please write simple code, so that I can try to follow it. In Javascript, using JSFiddle, we are going to create a Doubly Linked List. The List will be made up of Nodes. Each node will have the following properties; Node Properties id - A simple id for the node itself, content - A value (String) next - A pointer to the next node in the List (null for the last node). last - A pointer to the previous node in the List List Properties head - Pointer to the first node in the list length - Number of nodes in the list Next - you will populate your list with 5 nodes with content A, B, C, D, E. You will also create a print function for the list that will print the nodes in order. You will need to create some functions to support this functionality. You will now need to write an interface to allow the user to add nodes to the end of the list. There should be a single text box to enter the Node content, and a button "Add to List". When the user adds a node to the list, then you should add the node with the content to the end of the list and print the new list. I need to have the HTML separated from the Javascript. Also, I am visually-impaired, so please do not upload an image, because I can’t see it; and the screen reader won’t read it to me. Please write simple code, so that I can try to follow it. In Javascript, using JSFiddle, we are going to create a Doubly Linked List. The List will be made up of Nodes. Each node will have the following properties; Node Properties id - A simple id for the node itself, content - A value (String) next - A pointer to the next node in the List (null for the last node). last - A pointer to the previous node in the List List Properties head - Pointer to the first node in the list length - Number of nodes in the list Next - you will populate your list with 5 nodes with content A, B, C, D, E. You will also create a print function for the list that will print the nodes in order. You will need to create some functions to support this functionality. You will now need to write an interface to allow the user to add nodes to the end of the list. There should be a single text box to enter the Node content, and a button "Add to List". When the user adds a node to the list, then you should add the node with the content to the end of the list and print the new list. Solution var list = null; //a function for creating a list function createList() { var value = document.getElementById("LinkName").value; var length = document.getElementById("LinkName").length; list = new List(value,length);
  • 2. document.getElementById("demo").innerHTML = list.print(); } //a function for adding a new node to list function addNode() { var id = document.getElementById("LinkName").id; var value = document.getElementById("LinkName").value; list.addNode(id,value); document.getElementById("demo").innerHTML = list.print(); } // Define the link object with following properties function Node(_id,_value, _last) { this.id=_id;// A simple id for the node itself this.value = _value; // The value stored this.last = _last; // A pointer to the previous link this.next = null; // a pointer to the next link return this; // returns the created node } Node.prototype.asString = function() { return "Node Value:" + this.value + " "; } // Define the List object function List(_value,_length) { // We will define the list with the first link defined this.length = _length; this.head = new Node(_id,_value, null); // Pointer TO the head is null this.last = this.head; // When created - head and last are the same. } List.prototype.addNode = function(_value) { var node = new Node(_id,_value, _last); if (this._length) { this.last.next = node; node.last = this.last; this.last = node; } else { this.head = node;
  • 3. this.last = node; } this._length++; return node; } //print function List.prototype.print = function() { var s = ""; var n = this.head; while (n != null){ s += n.asString(); n = n.next; } return s; } //create data structure object var _list= new createList(); //add nodes var node = new Node(_id,_value, _last); node.id = 1; node.value = "A"; _list.addNode(node); var node = new Node(_id,_value, _last); node.id = 2; node.value = "B"; _list.addNode(node); var node = new Node(_id,_value, _last); node.id = 3; node.value = "C"; _list.addNode(node); var node = new Node(_id,_value, _last); node.id = 4; node.value = "D"; _list.addNode(node); var node = new Node(_id,_value, _last);
  • 4. node.id = 5; node.value = "E"; _list.addNode(node); _list.print();