I'm making a list search tool to check for a specific name in a long list. I have been successful at hard coding the name into the regex, but I need it to be dynamic.
Here is the code:
function processString(){
document.getElementById('textArea').value = "";
var inputString = document.getElementById('textBox').value;
var userIn = document.getElementById('userInput').value;
var regex = //use variable 'userIn' for regex
$('#textArea').html(result);
if(result != null){
for(var i = 0; i < result.length; i++){
document.getElementById('textArea').value += result[i] + '\r\n';
}
}
}
No comments:
Post a Comment