Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

103
Views
Javascript video onclick this.play is not a function

I'm passing a reference to the video element into my javascript function but am getting the following error. What syntax should I use here?

HTML

        <video
          v-for="option in visualizerOptions"
          v-bind:key = "option.id"
          src="@/assets/testvideo.mp4"
          spinner-color="black"
          class="carousel__item"
          v-on:click="playVid(this)"
        />

Javascript

    playVid(this) {
      this.play()
    }

Uncaught TypeError: this.play is not a function

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Aha! I figured out the syntax on my own. Hopefully this helps others as I haven't seen this re-posted anywhere in my research.

The correct syntax to use here is ele.target.play()

    playVid(ele) {
      ele.target.play()
    }
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!