Referencing this in .querySelector
If I use the following to select a certain node var Link = document.querySelector('table .ctrlcLink'); I get the first column value for the column with class ctrlLink, which is what I expected. However, since I have an onclick event set to an other column in the same table, I would like to get the value of the .ctrlLink column that is on the same row as my clicked element. So I tried something like this: var Link = document.querySelector($(this).closest('tr').children('td.ctrlcLink')); But then I get "Failed to execute 'querySelector' on 'Document': '[object Object]' is not a valid selector."
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.