I have attached a snip of my code and the instructions I was given. I am supposed to convert line 33 to jQuery but I cannot seem to figure out what it should be.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

I have attached a snip of my code and the instructions I was given. I am supposed to convert line 33 to jQuery but I cannot seem to figure out what it should be.

/* verify acres text box entry is a positive number * /
function verifyAcres() {
var validity = true;
var messageText = "";
try {
if (!(acresBox.value > 0)) {
28
29
30
31
32
33
34
throw "Please enter a number of acres greater than 0.";
35
}
36
Transcribed Image Text:/* verify acres text box entry is a positive number * / function verifyAcres() { var validity = true; var messageText = ""; try { if (!(acresBox.value > 0)) { 28 29 30 31 32 33 34 throw "Please enter a number of acres greater than 0."; 35 } 36
jQuery Project part 1
• Download the Tuba Farm Equipment folder. This is a zipped folder. Extract all files.
• Make a copy of the folder so you still have the original in addition to the one you are converting to jQuery.
• Run the program to get an idea of how it works. Once you convert this part of the project code to jQuery, it should work the same as it does now.
• Convert the window load event listener and all JavaScript statements related to the first two fieldsets to jQuery statements. This includes the following lines of code:
o 19, 20, 25 (change to jQuery selectors)
o 33, 40, 91, 124 (acresBox.value must be converted to jQuery)
o 104 (.checked doesn't work. Hint: take a look at https://api.jquery.com/prop/)
o 127-131, 133-141 (event listeners)
o 160-165 (window load event listener)
• DO NOT convert the rest of the code to jQuery. We'll do that in part 2 of the project.
• It will be more challenging to convert getElementsByTagName on lines 19-20 since these use specific indexes. Remember, jQuery will always try to process all indexes in the
collection, so you have to figure out how to specify just the ones you want. I found this in the jQuery Selectors topic in the Reference section on the w3schools website.
• You no longer need the loop on line 134, but keep in mind that the event listener must be attached to all the input elements within the fieldset, not attached to the fieldset
itself. Take a look at the jQuery Descendants topic on the w3schools website.
Transcribed Image Text:jQuery Project part 1 • Download the Tuba Farm Equipment folder. This is a zipped folder. Extract all files. • Make a copy of the folder so you still have the original in addition to the one you are converting to jQuery. • Run the program to get an idea of how it works. Once you convert this part of the project code to jQuery, it should work the same as it does now. • Convert the window load event listener and all JavaScript statements related to the first two fieldsets to jQuery statements. This includes the following lines of code: o 19, 20, 25 (change to jQuery selectors) o 33, 40, 91, 124 (acresBox.value must be converted to jQuery) o 104 (.checked doesn't work. Hint: take a look at https://api.jquery.com/prop/) o 127-131, 133-141 (event listeners) o 160-165 (window load event listener) • DO NOT convert the rest of the code to jQuery. We'll do that in part 2 of the project. • It will be more challenging to convert getElementsByTagName on lines 19-20 since these use specific indexes. Remember, jQuery will always try to process all indexes in the collection, so you have to figure out how to specify just the ones you want. I found this in the jQuery Selectors topic in the Reference section on the w3schools website. • You no longer need the loop on line 134, but keep in mind that the event listener must be attached to all the input elements within the fieldset, not attached to the fieldset itself. Take a look at the jQuery Descendants topic on the w3schools website.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY