jQuery - unrecognized expression: :nth-child -
i trying select :nth-child
using jquery, show syntax error.
error: syntax error, unrecognized expression: :nth-child
here code
var i; jquery('#' + id + ' .tab-pane').each(function (id, t) { var n = jquery(this).attr('id', 'pane-' + t); var p_id = n.attr('id'); jquery('#' + id + ' .nav-tabs li:nth-child(' + + ') a').attr('href', p_id); i++; });
please check code missing here
on first iteration, there no value i
. query looks this:
jquery('#' + id + ' .nav-tabs li:nth-child(undefined) a').attr('href', p_id);
on following iterations, undefined++
, nan
, still won't work.
this won't work. solution set i
1
(or whatever value necesary) on first loop:
var = 1;
Comments
Post a Comment