A
A
Antonio092020-04-18 20:34:14
JavaScript
Antonio09, 2020-04-18 20:34:14

How to add the value of its value attribute to the text of each option ( option )?

https://jsfiddle.net/gkyshtob/2/

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2020-04-18
@Antonio09

document.querySelectorAll('#select option').forEach(n => n.innerText += n.value);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question