That is because first-child(2)
is not a function so it will give an error.
It should be:
$('dd:first-child, dd:eq(1)').remove();
or
$('dd:eq(0), dd:eq(1)').remove();
or
$('dd:nth-child(1), dd:nth-child(2)').remove();
This might also work:
$('dd:lt(2)').remove();
Edit:
To delete the <br>
you can do:
$('dd br:lt(2)').remove();
3
solved First child does not work with my selector