I have this code:
$(\"#test\").siblings(\'p\').remove();
$(\"#test\").remove();
How can I chain this code instead of writing it separately?
May be off topic.. you can change the view of the problem:
$("#test, #test ~ p").remove(); // !! incorrect way, see comment below
Guys sorry :( my decision isn't correct!!
Selector '~' isn't equal 'sibling'-method. '~' selects all sibling 'p'-elements that follow AFTER the '#test' element.
So i suggest another decision:
$("#test, > p", $('#test').parent()).remove();
It is not enough elegant but the most faster way. Please check it 'http://jsperf.com/how-to-chain-this-code-stackoverflow-16009101'
Performance test result:

PS http://jsfiddle.net/Dpe59/