I have the following code:
<ul class="dropdown-list-autocomplete" id="Layer_1abc" data-layer="Layer_1"></ul>
And this JS:
function AtivaAutoComplete(id_mapa, regiao, path_map){
$("ul#dropdown-list-autocomplete[data-layer='"+id_mapa+"']").append('<li>'+regiao+'</li>');
}
What I want to do is: The tag that contains the data-layer
element with the value Layer_1
or Layer_2
, etc .. It will get the value of append()
, but this is not working. It only works when I say what #ID it is.