I am writing a program that takes all of the text from a text box, parses it into an array removing white-space, and then will search the array for expected values.
I can test it and get the program to successfully take the text in the text box and parse it into the array, but when I try to find the expected values in the array, it throws an error. The error is, "Object doesn't support this property or method".
JavaScript:
function generateOutputfvoc()
{
var inputArr = document.getElementById("inputBox").value.split(/[\s]/);
var nameLoc = inputArr.indexOf("Name");
document.getElementById("contactNameOutput").innerHTML = nameLoc;
}
HTML snippet:
<p>Paste Text Here</p>
<textarea rows='8' cols='152' id='inputBox' placeholder="Copy text and paste here" wrap="off"></textarea>
<form><input type='button' onclick='generateOutputfvoc()' value='Generate Output' /></form>
<p>Contact Name: <b id='contactNameOutput'></b></p>
Thank you.