2

Lately, there have been numerous questions being asked on SO, with , both tagged.

For example consider this case : User wants to hide an element.

Javascript :

document.getElementById("divId").style.display="none";

jQuery :

$('#divId').hide()

Some might accept the second as it seems easy to understand and implement.

Almost every question has an answer in both plain old javascript and modern jQuery. But if a user has the whole project with 1000 lines of plain javascript code, is it advisable to use jQuery in such cases?

What should an answering person take as priority :

  1. The order in which the tags are used? (So, if javascript is tagged first, answer should be in javascript)

  2. The most optimized way to solve the problem.

  3. The language currently used.

4
  • 2
    jQuery is still Javascript. I don't understand why people keep thinking it is a new language. and if the question is tagged with [jquery], give jQuery solution, and it is still a Javascript solution (with jQuery dependency). you can add non-jquery solution for completeness if you want.
    – Bryan Chen
    Commented Jun 26, 2014 at 5:41
  • @BryanChen I know jQuery is still Javascript, but if the current code is in pure javascript, what should be the answer based on?
    – Shaunak D
    Commented Jun 26, 2014 at 5:48
  • 3
    if the question is tagged with [jquery], OP probably accept jquery answer. if OP don't want jquery, [jquery] tag should be removed.
    – Bryan Chen
    Commented Jun 26, 2014 at 5:51
  • @BryanChen You have the answer. Please post it as such.
    – oberlies
    Commented Jun 26, 2014 at 11:53

1 Answer 1

4

If the question is tagged with , the OP will probably accept jQuery answer. However, you can add extra non-jquery solution for completeness if you want.

If OP doesn't want jQuery, then the question shouldn't be tagged with .

You must log in to answer this question.

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