Input and onchange

Hey,
I’m trying to use :
<input id="quantity" type="range" min="0.5" max="4" value="1" step="0.5" oninput="showVal(this.value)" onchange="showVal(this.value)"/>

with a showVal :
showVal($value) { console.log($value); }

But in my app i got Uncaught ReferenceError: showVal is not defined
By the way, the js file is ok, others functions works, and i got this error only if i use my function in the input.
I would like to not use ion-range (CSS problems)

What am I doing wrong?

Thank you already

Try using (change) instead of onchange. In your example: (change)=showVal(quantity) [(ngModel)]="quantity"

3 Likes

wow you save my time
thank you

1 Like

Thanks a lot’s Ricardo Moran of programming.

pd. Search “Ricardo Moran Peru” in Google :wink: