1
Good afternoon, i have a checkbox selected (check = true)
<div class="form-group col-xs-12 col-sm-12 col-md-3 col-lg-3 space">
<div class="input-group">
<span class="input-group-addon">
<input type="radio" id="cat5" name="rd_categoriaRamal" value="cat5" checked>
</span>
<label class="form-control" for="cat5">Cat. 5</label>
<span class="input-group-addon"><span id="teste" class="fluigicon fluigicon-info-sign bs-docs-popover-hover" data-toggle="popover" title="" data-content="Ligações locais, celular e DDD." data-original-title="Popover title"><label class="form-control" for="cat5">Cat. 5</label></span></span>
</div>
</div>
and I want to take the value of the data-content that is close to it:
"data-content="Ligações locais, celular e DDD."
I tried with that code here, but unsuccessfully:
var explicacaoCategoriaRamal = $('input[name=rd_categoriaRamal]:radio:checked').closest("span .fluigicon").data("content");
Can anyone explain to me why it’s not working? I tried some variations of it without success.
Try it this way
var explicacaoCategoriaRamal = $('input[name=rd_categoriaRamal]:radio:checked').closest("span .fluigicon").attr("data-content");
– PauloHDSousa
Unfortunately, so does not work. Gives Undefined.
– CarlosM