You can place the script in the head or body as you like. The script will behave as if it was located exactly where you put the script tag in the document.

The sentences above are taken from this JavaScript tutorial (at the very bottom). I think they made a grammatical mistake here: it should be behave as if it were rather than it was. I'm not 100% sure, so want to confirm it.

  • 4
    Using "was" instead of "were" in situations like this is incredibly common in current-day English, and should not be considered a grammatical mistake. The various uses of the subjunctive tense are slowly being lost from English, and I expect this will be the next one to go. Commented Jan 15, 2014 at 20:11
  • 3
    @PeterShor Queen Elizabeth once said, "For the avoidance of doubt, there is no such thing as American English. There is the English language and there are mistakes."
    – Terry Li
    Commented Jan 15, 2014 at 20:25
  • 3
    Of course Queen Elizabeth does not count because it was her whole bloody job to say that. She also does not count because her own great-great-great-grandmother wouldn't have understood a single word of that would-be "English". Lastly, she does not count because little did she know some dialects in the US would be better at nurturing her English than the Brits who basically went on to rape and murder it, such that there are actually people in the US right now speaking a purer English than Her Majesty Elizabeth II could ever dream of acquiring.
    – RegDwigнt
    Commented Jan 15, 2014 at 20:47
  • 1
    @PeterShor Always bearing in mind that the subjunctive is not a 'tense' but a 'mood'.
    – WS2
    Commented Jan 15, 2014 at 21:19
  • 1
    Whatever Queen Elizabeth says, this particular grammar "mistake" is more common in the UK; see Ngram. Commented Jan 15, 2014 at 22:04

4 Answers 4


Peter's comment indicates he feels 'were' is the preferred phrasing, and so do I.

'behave as if it were' is meant to indicate it is counter-factual (substitute 'even though it's not') so the subjunctive should be used.

Also it just sounds better that way to me.

  • I have a sentence from a news paper, it says: "At the time Musk said that the development of the prototype could take one or two years if it was his top priority." This sentence doesn't follow your 'the rule you mentioned'. Please explain it. Thanks
    – Kalvaniya
    Commented Dec 21, 2017 at 8:03

You can place the script in the head or body as you like. The script will behave as if it was/were located exactly where you put the script tag in the document.


The version with the modal preterite "was" is grammatical, and is acceptable.

As to the version with the irrealis "were": Since the matrix clause has present tense, that irrealis "were" version is also grammatical. It has the same interpretation as the version using the modal preterite "was".



There is a related section in the 2002 reference grammar by Huddleston and Pullum et al., The Cambridge Grammar of the English Language (CGEL), within their section "As if and as though", pages 1152-3. It has interesting info that answers the OP's question and some related questions, such as those about:

  • open vs remote conditionals,
  • irrealis "were" versus preterite (past-tense),
  • irrealis "were" versus past-perfect,
  • hypercorrection with irrealis "were".

The CGEL excerpt:

Irrealis were and the preterite

The as if/though construction is one of those that allow irrealis were or a modal preterite. Where the matrix clause has present tense, we have the expected contrast in the content clause between were or modal preterite (e.g. "was" -- F.E.) and present tense:

[42] He moves about on camera, angular, emaciated, graceful, as if his body were/is weightless.

The version with irrealis were is motivated by the fact that his body is not actually weightless, i.e. by the counterfactuality of the content clause. The version with is, by contrast, presents his body's being weightless as an open possibility, thereby suggesting that he gives the appearance of being weightless.

Compare also She acts as if she hated me and She acts as if she hates me (=[40.iii]). The latter conveys that the way she acts suggests that she does hate me and may well do so, whereas the modal preterite hated presents her hating me as a more remote possibility (though it is certainly not presented as counterfactual).

Less straightforward is the case where the matrix clause is in the preterite:


  • i. He was treated as if he were a Commonwealth citizen.
  • ii. As the trooper left the room, the gambler turned to the army girl with an odd expression, as though he were remembering painful things.

The natural interpretation of [i] is that he was treated like a Common citizen although he wasn't one. Example [ii], however, doesn't imply that he wasn't remembering painful things: on the contrary, it suggests that he was or appeared to be.

In [i] we could have as if he had been a Commonwealth citizen, with the perfect marking backshift (or past time) and the preterite marking modal remoteness; it is, however, much more usual in such contexts to have an irrealis or simple preterite after as if/though than a preterite perfect.

The irrealis in [43.ii] does not appear to be semantically motivated: certainly if we had a simple preterite in this context we would have no reason to regard it as a modal preterite. This were is therefore probably best regarded as belonging with the 'extended' uses of the irrealis discussed in Ch. 3, &1.7. Like them, it has the flavour of a hypercorrection: was is a less formal variant of were in modal remoteness constructions like [i], so that some speakers feel were to be stylistically preferable to was in similar constructions where was was not traditionally stigmatized. [fn 3]


footnote 3: This extended use of irrealis were is occasionally found in constructions where the matrix has present tense: It sounds from the guide book as if Verona were worth a visit. The flavor of hypercorrectness is stronger here: the example falls under the use of as if seen in [40.iv], which indicates that the content clause is relatively likely to be true, making the irrealis semantically inappropriate.


I think there can be no doubt that the use of the subjunctive mood is preferable, even if the use of the subjunctive as a whole is waning.


Where a simple "if..." clause is concerned, I am clear about when to use "were" and when to use "was".

My problem is that I am not convinced that "as if..." functions merely like an "if..." clause with a prefatory "as". I wonder whether "as if..." works differently and am inclined to think it's wrong to import into our use of it the 'rules' governing "if..."

Consider "He spoke as if he were possessed."

This could be glossed, "He spoke like someone who was possessed." It would be gross to gloss it, "He spoke like someone who were possessed."

My suggestion is that "as if..." functions like "like..." and in the latter case the standard 'rules' about "was" and "were" in relation to "if" don't apply.

  • Regarding your gloss example, you're overlooking the key point: that it's not known whether the subject "he" is possessed, but it is known that "someone who was possessed" is, ipso facto, possessed. Subjunctive vs indicative. Commented Jul 27, 2016 at 12:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.