Does anyone know now can I get the element object by using JQuery?
For Example: I have the following code to pass in the element object into the function
HTML:
<table> <tr> <td> <input type='text' ID='test' onchange='test(this)' /> <input type='text' ID='test_1' onchange='test(this)' /> <input type='text' ID='test_2' onchange='test(this)' /> <input type='text' ID='test_3' onchange='test(this)' /> </td> </tr> </table> JavaScript:
function test(obj) { var parent = $($($(obj).parent()).parent()).parent(); } Instead of passing the object over from html ( onchange='test(this)' ), any way I can capture the object by using jquery within the function by using the input ID?
.parent()returns a jQuery object. There is no need to keep wrapping it in$()tableas an object? The<tr>,<td>?