Having a bit of problem with some syntax trying to insert HTML after an element.
$('<div id="newdiv" style="height:' + heightvar +'"></div>').insertAfter('#mydiv');
The new div inserts in the correct place but is missing the height property in the style so looks like this.
<div id="newdiv" style=""></div>
Can you see the problem with my syntax?
I’m guessing you forgot the units in your
heightvarvariable.heightvar = '10'would result in a blank style attribute, butheightvar = '10px'would not.