I am trying to get the month that is 3 months from a selected month using a html select box and jquery in the below code. The code is not adding two variables together instead its treating them as two strings. Could anyone assist me to get this right?
<body>
<form role="form" class="form-inline">
<div class="form-group">
<label class="control-label" for="Q1Month">
Quarter 1 Month
</label>
<select class="form-control" id="Q1Month">
<option selected value=''>--Select Month--</option>
<option value='1'>January</option>
<option value='2'>February</option>
<option value='3'>March</option>
<option value='4'>April</option>
<option value='5'>May</option>
<option value='6'>June</option>
<option value='7'>July</option>
<option value='8'>August</option>
<option value='9'>September</option>
<option value='10'>October</option>
<option value='11'>November</option>
<option value='12'>December</option>
</select>
</div>
</form>
<script src="js/jquery.js"></script>
<script>
$(function() {
$('#Q1Month').change(function() {
var month = $(this).val();
$('#Q2Month').val(month);
var advanceby = 3;
var newmonth = month + advanceby;
window.alert(newmonth);
});
});
</script>
</body>