In the newer versions of IntelliJ Ultimate it is enough to place cursor inside your tag, press alt+enter -> Inject language or reference -> JavaScript.