-1

my code:

$( ".panel article:first-child" ).prepend( "<p>Test</p>" );

loaded in body. i see <p>Test</p> in the html in the correct place, but rendered with no height.

any help? thanks.

vulgarbulgar
  • 845
  • 1
  • 13
  • 28

2 Answers2

0

If you want to see its height then you need to prepend it with a certain height value like this:

  $( ".panel article:first-child" ).prepend( "<p style='height:20px'>Test</p>" );
renakre
  • 8,001
  • 5
  • 46
  • 99
0

as @david-thomas mentioned, no-repro. the issue was the element i was targeting was rendered after the .prepend. i tested with another target, and worked as expected. sorry for the crappy question.

cheers.

vulgarbulgar
  • 845
  • 1
  • 13
  • 28