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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:55:21+00:00 2026-05-13T16:55:21+00:00

Having this button on my page: <input type=button id=Button1 value=OK class=buttonClass width=150px/> and using

  • 0

Having this button on my page:

<input type="button" id="Button1" value="OK" class="buttonClass" width="150px"/>

and using jQuery 1.3.2, if I run this command:

alert($('.buttonClass').attr('width'));

I get ‘150px’ in all browsers but in IE (any version) I get ‘0’.

if I add a custon attribute in the button’s tag, something like this:

<input type="button" id="Button1" value="OK" class="buttonClass" myattribute="150px"/>

then the command:

alert($('.buttonClass').attr('myattribute')); 

works in all browsers including IE and returns ‘150px’.

Does anyone know what is going on here and if there is a fix?

  • 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-13T16:55:21+00:00Added an answer on May 13, 2026 at 4:55 pm

    UPDATE: Simplified and removed stuff about using DOM properties rather than attr().

    Firstly, the width and height attributes of an input should be integers rather than length values; pixels are assumed.

    Secondly, and this is what’s causing the problem (as you can prove by changing the input type to “image”), width and height attributes are only appropriate and only affect rendering in the browser for inputs of type image. For buttons, you need to use CSS to change the dimensions.

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

Sidebar

Related Questions

Having this errors when trying to compile/run my app using Maven. I've succeeded to
In this page there's a way to dynamic add html (textbox,input button and radio
Im having this code %button.aristo-default.accept{:href => #, :onclick => $.post('/sessions/accept_invite', { user_id: 1, friend_id:
Having this div: <div id=advSearchDialog style=visibility:hidden;> <xx:search ID=searchUC runat=server /> </div> And a button:
Having this code: using (BinaryWriter writer = new BinaryWriter(File.Open(ProjectPath, FileMode.Create))) { //save something here
Hai I am having a form which contains a filetype like this <tr><td> <input
I'm having trouble getting two variables to post using ajax and jquery upon pressing
I am having a PHP (HTML) page with 2 buttons.One button is used to
First of all: This page is for an online pharmacy. We are using a
I'm having some trouble using jQuery's plugin Facebox to process some data from a

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.