I have this html code:
<div class="option">
<h4 class="form-label">Quantité de data</h4>
<select class="selectpicker" name="Quantité de data" id=datanb>
<option value="10">10 gb</option>
<option value="20" selected>20 gb</option>
<option value="30">30 gb</option>
</select>
</div>
And I want to change this code:
<h2 class="price" id="lol"> 29€ - 1semaine - 20gb </h2>
The value 20 to be 10 or 30 depending the value in theselectpickers.
I've tried this with jQuery, but is doesn't work.
if ($('#datanb').is("10 GB"))
$('#lol').text('19€ - 1semaine - 10gb');
if ($('#datanb').is("30 GB"))
$('#lol').text('19€ - 1semaine - 20gb');
if ($('#datanb').is("20 GB"))
$('#lol').text('19€ - 1semaine - 30gb');
How do I fix it?