Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript jQuery variable Re: jQuery variable

#134438
Malgosia
Participant

$ function returns collection of elements – a list. In your case it is one element list, but it’s still a list. You have to specify what element from the list you want to get. Use first() function and it shoud resolve your problem.

like this:
$(‘#kort .id1 a’).first().attr(‘href’,$(‘.kort-nav li.id1 a’).first().attr(‘href’));