Bruce Walker
Bruce Walker

Reputation: 85

How to add dynamic height to a div along with its html code using jquery?

Here's the code not working while attempting to add the html code along with programmatic height..

$("table").after("<div style=height: '"+getHeight+"'></div>");

The div gets added but without the programmatic height.

Upvotes: 0

Views: 28

Answers (1)

potashin
potashin

Reputation: 44601

You are posting invalid html :

$("table").after('<div style="height:' + getHeight + 'px"></div>');

JSFiddle

Upvotes: 2

Related Questions