• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
    • Questions
    • Teachers
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

128
Views
function not returning results when called from html file

I am trying to write a script that returns data based on the option (player) selected in the drop down. This post got me 90% of the way there, but I'm tripping over the last piece.

When I select any of my players from the drop down, I expect the sidebar to be populated with that player's stats, but it seems it returns nothing.

I have an onchange event that runs the function selectChange(this), which passes the name of the player I've selected to the function selectChange().

The selectChange() function runs function stats(), which returns the stats of the player for whom the function was passed

I assign what function stats() returns to a variable ("stats") and I overwrite my HTML element with the id "data" with those contents.

I know the stats() function is good - when I run function stats() independently and pass it a player (i.e. stats('David Justice')), I get an expected return. So it's something to do with how I'm calling it in my html file, or how I'm passing the select.value component. I tried String(select.value) but that didn't seem to help. I suspect my error is trivial, but I can't find it!

enter image description here testStats function returns data as expected

almost 3 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error