As a newcomer to Javascript, my goal is to extract values from text fields and form groups. Here's a snippet of the code I've been working on:
var phoneNumber = document.getElementById("phoneNumber");
var email = document.getElementById("email");
var type = document.getElementById("typeNotification");
function addButton(){
var typeNote = alert(email);
console.log(email);
console.log(phoneNumber);
}
<div class="form-group">
<select id="typeNotification" class="form-control">
<option>Shock Sensor</option>
<option>GPS Jamming</option>
<option>Ingition off</option>
<option>Temperture</option>
</select>
</div>
<input type="text" id="phoneNumber" class="form-control" id="exampleInputSMS" aria-describedby="emailHelp" placeholder="Enter phone number">
<input type="email" id="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="Enter email">
<button type="button" onclick="javascript: addButton()" id="addNotification" class="btn btn-primary" >Add Notification</button>
Although in tutorial videos they use document.getElementById("typeNotification").value, for some reason I'm unable to include the .value part. Any suggestions on what I should do?