EDIT (2+ years later)
I can no longer delete this question, despite it being one of the most cringy bodies of text I have read in my life. Apologies for wasting everyone's time in writing it.
This post is about the suffering of this question, which has perished under the mistakes of many users, some of which are moderators or have higher powers. Please note that I am not critizising them, as their mistakes were justified based on the contexts which they had. The question has been like the Titanic, as so many errors added up to the current result of it. The users involved are:
Below, is the sequence of events which ensued from the beginning of this question's history:
1. The question
The question asked by Anish Kasam was not of the best quality, nor was it of the worst. It included HTML
and JavaScript
code, and included an issue (in the title):
I can't see why my JS function isn't doing anything (finding if the number is prime)
The question could be improved, but doesn't need to be closed.
2. The answer
I spent extensive time composing this answer, but never actually got to post it (as explained later):
Do a few things in your HTML and JavaScript: 1. Change
<input type="submit" id="submit" onClick="isPrime()"></input>
to<button id="submit">Submit</button>
. 2. Add theonclick
event in the JavaScript, not the HTML. As for the code for checking if a number is prime or not, have a look at a more compressed version in the below snippet: (code snippet) Hope this helps! :)
3. The edit
This edit, by ncubica, the root of the entire problem, changed the title to:
Finding if the number is prime
– thus rendering the question not a question, because the problem of the question was explained in the title.
4. The comment
Soon after the above edit, meagar ♦ posted this comment:
You haven't asked anything resembling a question. You haven't even said if your code is working or not.
– but Anish Kasam did, with the title:
I can't see why my JS function isn't doing anything (finding if the number is prime)
– so it was ncubica's fault, as seen in 3. The edit. This is the first case of limited context, as this comment is reasonable only if the question originally had that title, but it didn't.
5. The closing
Soon after the above comment, meagar ♦ and PreferenceBean put the question on hold:
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking.
– the result of ncubica's edit of the title, another case of limited context. Consequently, I could not post my answer, as I protest about in this question.
6. The enlightenment
Thanks to the work of Satej S, this comment was posted:
@meagar , this was actually his first title I can't see why my JS function isn't doing anything (finding if the number is prime)
– this is why I found out what the original title is.
7. The first attempt of recovery
I tried to recover the question, with this suggested edit, which adds the information of the original title into the body of the question. It got denied by Amit Vaghela, wogsland and Ronak Shah:
This edit does not make the post even a little bit easier to read, easier to find, more accurate or more accessible. Changes are either completely superfluous or actively harm readability.
Why they all rejected it, I have no idea, when the edit seen in 3. The edit was accepted.
8. The second attempt of recovery
I then posted this comment on the question:
@meagar, please accept my edit of the question, which reinstates the original information of the question. The original title, "I can't see why my JS function isn't doing anything (finding if the number is prime)" (thanks Satej S), held enough information for the question to stay open. ncubica deleted that title, thus causing it to close. It is not the OP's fault, it is ncubica's. I started an answer and want to post it. Thanks! :)
– but to no avail.
And so is the story of that question, which now seems to be stagnate. Although a small matter, I hope this question will receive some attention, and shed some light on the system itself.
Thanks for reading! :)