1. (50 points)The Top 100 Mystery Novels of All Time chosen by Mystery Writers of America is shown to the left in a form named f1 and a textarea named ta1. There are three pieces of information for each novel:
title followed by a "*"
author followed by a "*"
rank followed by a "#" (except the last one)
Assume the following two arrays are defined in p1:
var authors = ["Agatha Christie","Dashiell Hammett","Dorothy L. Sayles", "Graham Greene","Raymond Chandler","John Grisham"];
var counts = [0, 0, 0, 0, 0, 0];
Write the javascript function named p1 that:
retrieves the data from the textarea ta1
creates a 100 row by 3 column table showing in the column data in the following order (left to right):
rank
title
author
following the table, display the author names and counts for each of the six novelists stored in the array named authors (i.e., count and display the names and the number of times each of the six authors appear on the list)
place the resulting table and six author's names and counts in the DIV block whose id="p1_out"
this is the DIV block with id="p1_out"
Do not make a heading row for the table. Show NO HTML. Show only the javascript for p1.