Write a JS program that takes an e-mail from an input field and deletes matching rows from a table. If no entry is found, an error should be displayed in a <div> with ID "results". The error should read "Not found."
Input/Output:
There will be no input/output, your program should instead modify the DOM of the given HTML document.
Sample HTML:
<table border="1" id="customers">
<tr><th>Name</th><th>Email</th></tr>
<tr><td>Eve</td><td>eve@gmail.com</td></tr>
<tr><td>Nick</td><td>nick@yahooo.com</td></tr>
<tr><td>Didi</td><td>didi@didi.net</td></tr>
<tr><td>Tedy</td><td>tedy@tedy.com</td></tr>
</table>
Email: <input type="text" name="email" />
<button onclick="deleteByEmail()">Delete</button>
<div id="result" />
Examples:
