How to work with an object in JS? I get the object in this way:
$(document).ready(function() { $('.button').on('click', function() { var Test = $(this).parents('div').find('a'); }); }); In order to display text() use the console.log(Test.text()); there is no problem with this, but when I try to output href , it displays undefined console.log(Test.href);
console.log(Test[0].href);console.log(Test.attr("href"));- Igor