0
I would like to know the following. I am using the jquery’s data function. As HTML code is dynamically created, I cannot assign the date.
//Aqui tem um each
$('#div').append('<span class="vor" data-tipo_m="'+v.cob_tipo_mapa+'">'+v.cob+'</span>');
I tried to take the last value of the class .vor
and adds the date function. But it was not possible.
So I added manually, as in the example above:
$('.vor:last').data("tipo_m", v.cob);
My question is, it will work in any browser. Because the jquery date() when I inspect the element does not appear. Already the way I did create the attribute and then get the value with date() of jquery.
There is no problem in doing it the way you did. Using the date is just an alternative. Note that current jquery does not support older browsers such as IE 6 (not sure about IE 7).
– EduardoFernandes
If the answer I have solved your problem please mark it as correct by marking the green tick. Thank you ;)
– EduardoFernandes
jQuery 2.x supports only IE 9+, so it does not support IE 8. jQuery 1.x supports IE 6+.
– Vinícius Gobbo A. de Oliveira