I wish this help you .click() binds events only to elements that are existing at the time of calling .click(). If you want the events to be handled for elements that are created later on, use .on() or .live(), depending on the version of jQuery you are using. Read the very helpful info here.
How to use Element Selector with Class Selector in Jquery
like below fixes the issue Since you said you don't want dom relationship to be used another approach could be is to use a attribute value. For example you can use a data-id attribute where you specify a number, where the same number will be associated to the related new-answer and answer-box element.
var id = $(this).data('id');
$('.answer-box[data-id="' + id + '"]').toggle();
This might help you In jQuery, how can I get an element's arbitrary level parent element with a specific selector? I don't know exactly where it is, I just know that it exists somewhere in the DOM above the current element. Here is a primitive example what I want: , You're looking for this:
'Does not have class' selector in jQuery. Select an element by particular class name which holds multiple classes