Answer the question
In order to leave comments, you need to log in
How to change the value of the data attribute?
Good day.
The task is the following.
There is a form structure
<div class="checkbox">
<label><input type="checkbox" id="calculator-yandex" class="calculator-switch" /> Настройка рекламной кампании Яндекс.Директ</label>
<a class="calculator-question" data-toggle="modal" data-target="#calculator-modal1" href="#">?</a>
</div>
<div class="calculator-yandex calculator-hided calculator-option">
<div class="input-group">
<span class="input-group-addon">Рекламных кампаний Яндекс.Директ:</span>
<input class="form-control" type="number" step="1" data-default="1" value="1" min="1" data-cost="7550" />
</div>
</div>
<hr />
<div class="checkbox">
<label><input type="checkbox" id="calculator-google" class="calculator-switch" /> Настройка рекламной кампании Google.Adwords</label>
<a class="calculator-question" data-toggle="modal" data-target="#calculator-modal2" href="#">?</a>
</div>
<div class="calculator-google calculator-hided calculator-option">
<div class="input-group">
<span class="input-group-addon">Рекламных кампаний Google.Adwords:</span>
<input class="form-control" type="number" step="1" id="google-total" data-default="1" value="1" min="1" data-cost="7550" />
</div>
</div>
Answer the question
In order to leave comments, you need to log in
1. option.
I will cut it so as not to write a lot
if(яндекс){
data-cost="7550" //тут целый input
}else{
data-cost="5000" // тут целый input
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question