To get the selected item, use the
selectionIndex
property:
var P1 = document.getElementById("bammon1");
var Pokemon1 = P1.options[P1.selectedIndex].text;
Also, I don't know why you have empty
pokemon1
attributes in your
option
tags, but I don't think they should be there -- it's invalid HTML. If you actually want to put (and use) values in them, make the attribute name start with
data-
(for example,
data-pokemon1
). This kind of attribute is called a data attribute:
https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Using_data_attributes[
^]