18

Today I came across this question from this Google search.

The title of the question is:

Set class with jquery?

The body contains lots of code and says:

When the panel is hidden and we press the div button(extraFilterDropDownButton) the upper left part of the page will flicker and then the panel will be animated down.

When the panel is shown and we press the div button the panel will hide('slow'), but the button will not change to the correct class even when we set it in the UpdateFilterView script?

Note that the question doesn't contain the CSS required to reproduce this.

The accepted answer from the asker is:

I ended upp with somthing like this :

$(this).live('mouseover',function(){
   //something to do when mouse over
});

From what I understood, probably the asker's problem was that he was dynamically generating the HTML elements, which he never mentioned anywhere in the question, and the code does not include such code segments.


This is a famous question which is likely to be viewed by many jQuery beginners.

But a mismatch between the title and accepted answer will be confusing; also the amount of text is sort of useless (wastes the time of reader when he finally realizes that it had nothing to do with the title, nor the accepted solution) - it doesn't help to arrive at the accepted answer at all.

So if I'm to edit the question, I'll change the title to something specific (local) like

Unable to set the class on hover

Indicating it is more specific to the asker rather than a general Set class with jquery question.

What is the right thing to do with such a famous question...?

Edit? Vote to Close...? something else...?

5
  • 4
    Are you asking about bad titles in general, or about the example question, specifically? The example is a mess. The question is unclear. As you ask in your comment, what class is the OP expecting? It's not okay to require the reader to dissect the code to figure it out when it can be stated plainly. So downvote and vote to close as unclear. The OP's self-answer does not explain how it fixes the problem. So a downvote there too. The answer with the most upvotes is correct in the sense that the answerer is not saying something false but does not address the specific problem presented by the OP.
    – Louis
    Commented Oct 2, 2014 at 12:19
  • I'm asking in general, with an example so that next time i see one like this, i don't have to ask..
    – T J
    Commented Oct 2, 2014 at 12:29
  • I've added comment for OP of the linked question to update the post. Maybe no action needed on particular post, but good question in general. Commented Oct 2, 2014 at 21:54
  • 2
    If the title doesn't match what's being asked, it's a bad title; edit the question and give it a better title. That has nothing to do with the answers.
    – Air
    Commented Oct 2, 2014 at 22:44
  • If the answer doesn't match what's being asked, it's probably a bad answer; downvote it. That has nothing to do with whether it's marked as accepted.
    – Air
    Commented Oct 2, 2014 at 22:45

1 Answer 1

25

This has happened to me quite a few times; and each time, it's really annoying.

The best thing to do is to edit the bad title to reflect the actual question asked.

9
  • title edit makes perfect sense, but what to do about accepted answer which still remains mismatch?
    – gnat
    Commented Oct 2, 2014 at 14:41
  • 1
    @gnat The title should be reflected to fit the actual content. If it doesn't even after an edit; someone's off.
    – George Stocker Mod
    Commented Oct 2, 2014 at 15:01
  • 1
    no disagreement at all about title edit to match the question body, I wonder only about accepted answer that didn't match before edit and will remain misfit after it
    – gnat
    Commented Oct 2, 2014 at 15:03
  • 3
    @gnat note that that particular question's accepted answer is self answered... which, well, might have 'solved' the problem but in this case didn't answer the question.
    – user289086
    Commented Oct 2, 2014 at 17:01
  • 8
    @gnat: If the answer doesn't address the question in a way that's useful to anyone but the answerer, downvote it.
    – Ben Voigt
    Commented Oct 2, 2014 at 21:47
  • @BenVoigt agree, that's what I would prefer to do, I only wonder what's George's take on this
    – gnat
    Commented Oct 3, 2014 at 7:29
  • 1
    @gnat If the answer doesn't match the title or the question, it necessarily means the asker didn't form their question well. Can the question be edited along with the title?
    – jpmc26
    Commented Oct 3, 2014 at 18:19
  • @jpmc26 if question gets other answers in the meantime, this becomes problematic. Edits that invalidate (good) answers are not welcome at Stack Overflow... softly speaking. Even edits that match title to text aren't entirely safe, but at least answer invalidation if it happens, in this case can be justified by appealing to How to Answer guidance. As for the edits that pick a single answer and bend question to match it no matter what happens to others, these are really slippery
    – gnat
    Commented Oct 3, 2014 at 18:23
  • 1
    The person asking the question is always free to accept a bad answer; that's part of the nature of SO. I can't see anything you can do about it in the current design of the community, other than post a better answer and hope that folks vote it up over the accepted answer. Of course that presumes the question is coherent enough to be answerable in the first place.
    – keshlam
    Commented Oct 5, 2014 at 3:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .