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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T23:07:38+00:00 2026-06-04T23:07:38+00:00

To double the width of the img , i can do this in jQuery:

  • 0

To double the width of the img, i can do this in jQuery:

<img src='blah.jpg' id='pic' />

$('#pic').height($(this).height()*2);

that works fine, but i really like to use shorthand assignments like:

var count = 5;
count *= 2; // to get 10.

Since element.height returns the height function in jQuery, i can’t use shorthand assignments. Is there no way to do shorthand assignments in jQuery for element attributes?

  • 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-04T23:07:40+00:00Added an answer on June 4, 2026 at 11:07 pm

    You can modify the attributes such as height without using jQuery

    document.getElementById("pic").height *= 2;
    

    Or if you want to select the element with jQuery you can use this snippet.
    It selects the element and then accesses it directly using the indexer.

    $("#pic")[0].height *= 2;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a 2884765579 bytes file. This is double checked with this function, that
I am making a personal blog that people can download and edit, but the
Sorry, I don't have the exact code with me, but hopefully this works with
I bet this is really obvious but I can't find how to open the
I know the general guidelines to double-postbacks, but this one is driving me nuts
int newWidth = 100; int newHeight = 100; double ratio = 0; if (img1.Width
How can I replace (I think it's called double quotes) with '' (I think
I would like to initialize boost::random::discrete_distribution with a double[] like this: boost::random::discrete_distribution<>* distribution(double* _distr)
With this method declaration (no overloads): void Method(double d) { // do something with
So i'm trying to make a program that can find how many pixels of

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.