Answer the question
In order to leave comments, you need to log in
By what principle are new attributes added and retrieved in input, select, etc.?
Hey!
What is the principle by which new attributes are added and retrieved in input, select, etc. ?
Sandboxing jsFiddle It's
common to take the value value and display it on the page
var y = document.getElementById("oborudovanie").value;
info1.innerHTML = y
var z = document.querySelector(`option[value="${y}"]`).innerText;
info2.innerHTML = z;
Answer the question
In order to leave comments, you need to log in
var z = document.querySelector(`option`);
var value = z.getAttribute('value');
var postID = z.getAttribute('data-post-id');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question