Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to format the <output> of a type range slider?

I am trying to format the range slider so the result appear duplicated.
For eg. it returned 16 by default. I want under the slider to see 16×16, 32×32…Both numbers must move togheter.

Heres what i tried:

 <input type="range" min="2" max="50" value="16" class="size"
 oninput="this.nextElementSibling.value = this.value">
  <output>16</output

Is there a way to format the output?
Thank you

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

<input type="range" min="2" max="50" value="16" class="size" oninput="this.nextElementSibling.innerHTML = `${this.value}x${this.value}`"><output></output>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading