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 117085
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T03:16:49+00:00 2026-05-11T03:16:49+00:00

How to get real image width & height (cross browser) by JavaScript function ?

  • 0

How to get real image width & height (cross browser) by JavaScript function ?

  • 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. 2026-05-11T03:16:50+00:00Added an answer on May 11, 2026 at 3:16 am

    First of all, you have a greater chance of getting your question answered if you’d just ask it in a more polite way, and supplying as much relevant information as possible.

    Anyway…

    For as far as I know, you can use the .width property across pretty much all browsers:

    function getDimensions(id) {     var element = document.getElementById(id);     if (element && element.tagName.toLowerCase() == 'img') {         return {             width: element.width,             height: element.height         };     } }  <img id='myimage' src='foo.jpg' alt='' />  // using the function on the above image: var dims = getDimensions('myimage'); alert(dims.width); --> shows width alert(dims.height); --> shows height 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating a jQuery plugin. How do I get the real image width
So for example we have real life photo. how to get (relativly to image
What is the best way to get the size (width and height) of an
I need to get real world date and time in Java. I use: Date
I'm trying to get a real equivalent for Java's public static final in Scala
Is there any accurate way to get the real size of a svg element
I'm having a real trouble to get accents right, and I believe this may
I've been having real problems trying to get a ruby script to run through
Real noob question no doubt, but I can't get my head around this behaviour.
I need to create a real dynamic JPA CriteriaBuilder . I get an Map<String,

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.