HTML part
<select class="data_type">
<option value="inc" selected>+</option>
<option value="exp" >-</option>
</select>
<div>
<input type="text" placeholder="description" class="data_description">
<input type="number" placeholder="value" class="data_value">
<button class="add_btn">Add value</button>
</div>
javascript part
var uiController = (function() {
return {
inputVal : {
type:document.querySelector('.data_type').value,
description: document.querySelector('.data_description').value,
value:document.querySelector('.data_value').value
}
};
})();
whenever the object returns and i display it in the console it doesn't read any value from the input box and displays nothing
ex output in console --> {type: "inc", description: "", value: ""}
it only read the inc which is specified in the select type but not the input values
any idea why this is happening ? it should work according to me.