javascript - Add div to other ID div on button click -
here have code open in modal window:
contentstr += '<div>lorem ispum</div><button>add timeline</button></div>'; $(contentstr).dialog({ modal:true });
now want when click on button
add timeline add: '<div id="new">place.name</div>'
div id bottom
margin left var "n"
how can jquery?
assuming meant have var n
somwhere want apply margin left:
$('button').click(function(){ $('#bottom').append($('<div id="new">place.name</div>').css('marginleft',n+'px')); });
some word of advise, jquery basic, next time research please , show here found , struggle.
Comments
Post a Comment