Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In JavaScript text instructions: A) In Atom create a new file in your p4 folder named sumOfPDivs.html . Add the content, a text box, and

In JavaScript

image text in transcribedimage text in transcribed

text instructions:

A)

In Atom create a new file in your p4 folder named

sumOfPDivs.html

. Add the content, a text box, and a click

button

B)

Create a second file

sumOfPDivs.js

that will contain all of

your JavaScript code, and connect

sumOfPDivs.html

to

sumOfPDivs.js

C.

Copy your

sumOfProperDivisors

function from Project 3,

and paste it into

sumOfPDivs.js

, near the top of the file. (find sumOfProperDivisors code below):

function sumOfProperDivisors(n){ var result = 0; for(var x = 1;x 

Following the function declaration, define an onclick handler, (the call-back function that handles the onclick event).

Finally, add the code to register the event handler, at the bottom of the .js file. The completed web app should work like this:

When the user enters a number and then clicks the button, the function result is displayed on the web page.

3. [32 pts] sumOfPDivs.html and sumOfPDivs.js. This is an exercise in Client-Side JavaScript: you will need both an .html file and a .js file. A) In Atom create a new file in your p4 folder named sumOfPDivs.html. Add the content, a text box, and a click button as shown in this figure: Sum of Proper Divisors Enter a positive Integer N: [ Sum of Proper Divisors B) Create a second file sumOfPDivs.js that will contain all of your JavaScript code, and connect sumOfPDivs.html to sumOfPDivs.js. C) Copy your sumofProperDivisors function from Project 3, and paste it into sumofpDivs.js, near the top of the file. D) Following the function declaration, define an onclick handler, (the call-back function that handles the onclick event). E) Finally, add the code to register the event handler, at the bottom of the .js file. F) The completed web app should work like this: When the user enters a number and then clicks the button, the function result is displayed on the web page. as shown in this figures Sum of Proper Divisors Enter a positive Integer N:G Sum of Proper Divisors Sum 6<>

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Repairing And Querying Databases Under Aggregate Constraints

Authors: Sergio Flesca ,Filippo Furfaro ,Francesco Parisi

2011th Edition

146141640X, 978-1461416401

More Books

Students also viewed these Databases questions