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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:13:46+00:00 2026-06-13T06:13:46+00:00

$(selector).height(value) $(selector).width(value) We can use the above two ways to change the height or

  • 0
$(selector).height(value)
$(selector).width(value)

We can use the above two ways to change the height or width of a div or element. but there is also another way, like

$(selector).css({"height": "100px", "width":"100px"})

since the second way can be applied to all css element, why the first method?

  • 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-13T06:13:47+00:00Added an answer on June 13, 2026 at 6:13 am

    There is one major difference: in width() and height() you can use function as parameter which returns a value

    .height( function(index, height) )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to set a minimum height for a div, but still
When an html element has the height and width set to zero, jQuery does
I'm trying to use :after selector to draw a inside-border in every div I
i want to get the height property of a object: $('.selector img').each(function(index,e){ thisImage =
Possible Duplicate: CSS Selector that applies to elements with two classes So I have
How can I check selector to see if he is ending with number? JS
I have an iFrame like so: <iframe width=100% frameborder=0 height=470 allowtransparency=true name=productframe id=productframe style=border-bottom:1px
According to microsoft, IE8 and IE9 support the :after selector. I use this selector
I am making a personal blog that people can download and edit, but the
Should I use $button.eq(number_of_active_slide) or $button in the example below? The height of all

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.