- View Offline
- Exercise Files
- Now that this drag and drop is working,…let's go ahead and take care of the second site here…which is this form.…Right now, it has by default, the name of the page…that we want to process.…So what we're gonna do is, in our script,…we're gonna target some event,…so we'll add a comment down here.…What we wanna do is look for that form…so we'll do document.forms…and then we'll use the name of the form…which is called compare.…
You can take a look at the indext.html…so for example, the form is right here…and it has a name of compare,…and then the input field is right here,…and it has a name of url.…So we're gonna track that form…and then add an EventListener to it.…The event that we wanna track is the submit button.…When somebody submits this form,…then we're gonna execute a function…and capture that event.…
In here, I'm gonna create a temporary variable…called formUrl…and that's gonna get the URL from the input field.…So we'll do document.compare.url…and then read the value from that input field.…Then we also need to execute a…
Visit other courses in the series to see how to solve the exact same challenges in languages like C++, C#, Java, PHP, Python, R, Ruby, and Swift.
Skill Level Intermediate
1. Problem One - Exploring Lake Pend Oreille
2. Problem Two: Image Analysis
3. Problem Three: Eight Queens
4. Problem Four: Accessing Peripherals
5. Problem 5 - Recursion and Directories
6. Problem 6 - Building the Web
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.