First, I am pretty new to Javascript. I am trying to grab the value of an object and I can see all the information I need in the console, I just don't know how to access it. For instance, I'm looking at an HTML Collection, made from a dropdown. It has:
>0: option
>2: option
value: "6"
text: "apple"
spellcheck: true
textContent: "apple"
>3: option
value: "2"
text: "test"
spellcheck: true
textContent: "test"
>4: option
...
Inside each of these are a whole host of parameters and values. My question is, how do I search, select the parameters and use the values, in JavaScript? Keep in mind, the order and number of "option" will change. Value, in this case, is something of - value - It uniquely identifies the text "test" and "apple".
I can list all these out, easily enough, by selecting them and outputting them in the in console...
var a = document.getElementById("whatever");
a
but how do I access all those sub-properties? Also, I don't know what the proper terminology is for these parameters and values, in order to effectively search Google for an answer, if someone could help me with that, as well.
getElementByIdexample, what isa? Do you want the propertya.valuedirectly? Or is there a<select id="whatever">?a.valueora.textora.textContent?