jQuery: add content to end of div -


i have html:

<div class="region-list" id="region_north_america">     <strong>north america</strong> </div> 

and want add more divs after strong element result:

<div class="region-list" id="region_north_america">     <strong>north america</strong>     <div> ... </div>     <div> ... </div>     <div> ... </div> </div> 

i trying this:

var row_str = '<div>content here</div>'; $('#region_north_america div:last').html(row_str); 

however, there no change html. since there no div within element selected.

i know js making code because can print content of row_str console.

so, how can end of container element add new items?

thx.

try:

$("#region_north_america").append(row_str); 

using append().


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -