1
I have the following excerpt:
$('#div').html();
I need to add some div
within that div
, but I don’t know how, because if I try to do this way it’s wrong:
NOTE THE ADDITION SIGNAL FOR CONCATENATION
$('#div').html($('<div>',{id: 'divteste', class: 'divteste'}).html('DIV 1') + $('<div>', {id: 'div2', class: 'teste2'}).html('DIV 2'));
The question is: How do I concatenate the addition of several div
within a function html()
of jQuery
?
Ever tried with . append()?
– leofontes
I tried, but the problem is not creating the element itself, but creating several elements within html()
– Anderson Santos