1
How do I change the checkbox border color when, for example option 1 is selected?
Given my html code:
<div class="opcao-de-entrega">
<p class="menu-opcoes-titulo">
Opções de entrega
</p>
<div class="row">
<div class="col-md-4">
<label><input type="checkbox" value="1">Sedex 1</label>
</div>
<div class="col-md-4">
<label><input type="checkbox" value="2">Economica 2</label>
</div>
<div class="col-md-4">
<label><input type="checkbox" value="3">Retirar na Guiatel 3</label>
</div>
</div>
In the script I want to type only if I select the first input this is selected and the border appears, I am well Noob, type tried as on this screen has 3 input, do the if(input["0"].checked)
ai this turned red/blue etc, but I want that type I marked the input 1, for example, then I clear, the edge sum too. help?
$('.checkbox label')
$('input[type="checkbox"]').change(function() {
//var input = document.getElementsByTagName('input');
if(this.checked) {
//Do stuff
//this.style('border', '1px solid red');
console.log("aqui");
$('input[type="checkbox"]').parent().css('border', '1px solid red');
}
});
Tatah you can do this perfectly only with CSS, do not need JA or jQuery, if you are interested I reply with an example for you
– hugocsl
@hugocsl how? why type are 3 input you would use :active ?
– tatah
No, if it is required input it is better pq vc can use Valid and invalid, if it is a standard input you use Focus.
– hugocsl