The real value of posts like this one is that they are, literally, frequently asked questions (just take a look at the list of linked questions for the example question above if you don't believe me), and thus serve as useful targets for closing any duplicates of them that get regularly re-asked.
In particular, note that, if this question were closed (or, worse yet, deleted), we'd suddenly have literally dozens of duplicate questions linking to a question which is itself closed.
Ideally, such questions should be edited to clean them up and to make them clearly focused on the core of the issue. In this particular case, the question already is quite clean and focused; the only major complaint seems to be that it's short, but that shouldn't be seen as a problem in itself, if there question still provides enough information to clearly specify the problem.
The one detail that, arguably, could be removed would be the mention of jQuery, since the solution of the problem really has nothing to do with it. (It's a minor case of an X/Y problem; the OP thought jQuery would be the right tool for the job, so they asked about it, even though what they actually needed is just plain JavaScript.) However, if you look at the linked questions, a lot of them also mention jQuery, so it looks like even this particular mistake is common enough that having the word "jQuery" mentioned prominently in the question title is probably useful.
In short, IMO, this is not a poor question. It wasn't that when it was asked, and it still isn't — the only reason a question like it should be closed, if asked today, is that it'd be a duplicate. Furthermore, having this question on SO fulfills a very useful function as a target for closing any new duplicates of it.