I have an HTML element (that was generated using javascript) that has an onclick property set to run a function, like so:
<tr onclick="navtoprod()">
<td>item1</td>
<td>item2</td>
<td>item3</td>
</tr>
And I have a function:
function navtoprod() {
document.window.location = 'http://www.enviroptics.com/';
}
When I click on tr it returns that navtoprod is undefined.
Is my problem strictly syntax related? I've tried document.location and window.location separately and nothing worked. Heres my fiddle that I'm working on in case my problem is not as simple as I hope it is. https://jsfiddle.net/msirkin/kpkn13w7/
EDIT: I cant use a jquery solution