Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7078855
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:35:56+00:00 2026-05-28T06:35:56+00:00

Having a bit of problem with some syntax trying to insert HTML after an

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T06:35:57+00:00Added an answer on May 28, 2026 at 6:35 am

    I’m guessing you forgot the units in your heightvar variable.

    heightvar = '10' would result in a blank style attribute, but heightvar = '10px' would not.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having a bit of an odd problem while trying to compile some code
Hey, I'm having some difficulty with CSS and IE6 compatibility. URL : http://bit.ly/dlX7cS Problem
I'm having a bit of a problem here. I insert a date into the
I'm having a bit of a jQuery problem. Basically I have some functions that
Having a bit of an issue accessing dynamically added DIV's immediately after they've been
I am having a bit of a problem with some mysql. I will try
I'm having a bit of a problem deciding how to store some data. To
Having a bit of a problem, Due to the source-control set-up we use, each
Having a bit of a problem creating an instance of an object. Bear in
I am having a bit of a problem. I get a RAW char* buffer

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.