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

  • Home
  • SEARCH
  • 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 8884155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:59:46+00:00 2026-06-14T20:59:46+00:00

im no expert javascript coder. i used like 5 hours now trying alot of

  • 0

im no expert javascript coder.
i used like 5 hours now trying alot of different stuff. and i noticed some things that i cant figure out
im trying to get this to work

width = $('#immagineCont').attr('clientWidth');

but it returns undefined
i tried doing

width = $('#immagineCont').attr('id');

witch returned #immagineCont i guess is correct.

when i use

 $('#immagineCont')

i get this in firebug 1)
http://bildr.no/view/1325119 2)
http://bildr.no/view/1325120

so what im trying to do is get the damn clientWidth witch seems impossible. i even tryed children(“0”) and children(“#0”)
im going blow my brains soon ^^

  • 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-06-14T20:59:47+00:00Added an answer on June 14, 2026 at 8:59 pm

    attr would only work if there was an attribute with this name.

    You may simply use

    width = $('#immagineCont').get(0).clientWidth;
    

    but you more probably need

    width = $('#immagineCont').width();
    

    which is more reliable when you want to do something that works the same across browsers (but doesn’t include padding and borders).

    You might also be interested by outerWidth.

    A note about what happens and the need for get(0) : a jQuery collection (like $('#immagineCont')) wraps one or more standard DOM objects that you can get using get(i) or [i]. If you want to access native properties of the DOM object, when jQuery doesn’t offer a proxy function, you need to get this native object first.

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

Sidebar

Related Questions

I have googled some time now trying to find a good sample application that
I'm far from a JavaScript expert but I'm trying to migrate some mootools code
First of all, I'm not a javascript expert. I'm going crazy on trying to
I'm looking for some sort of jquery plugin (or even plain javascript) that can
I have some html and JQuery that is used to create a page with
Before I get to the actual question I would like to clarify some things
I have a simple javascript question (I'm not a javascript expert, so excuse me
I'm not very expert in using javascript and jquery but I'm working with them
Can any expert here please point me to some valid walkthrough on how to
I am trying to use a Javascript callback to a Flex application embedded in

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.