There are two values in function. Input and select, everything works normally except that the select returns the first value (px). Where did I get it wrong?
<input id="width" onchange="Width()" type="number" placeholder="0" min="" max="" step="0.1">
<select id="widthpixselpercentage" onchange="Width()" >
<option value="px">px</option>
<option value="%">%</option>
</select>
<div id="someDiv"></div>
function Width(){
var x = document.getElementById("width").value;
var y = document.getElementById("widthpixselpercentage").value;
document.getElementById(someDiv).style.width = x + y;
}