explain width() vs css(‘width’) in jquery



explain width() vs css(‘width’) in jquery..

Answer / Dharmendra Kumar Mourya

[n {n "method": ".width",n "description": "Returns the width of an element, in pixels. The value includes padding but not border or margin.n ",n "example": "n $('div').width(); // Returns the width of the first div on the page in pixels"n },n {n "method": "css('width')",n "description": "Returns or sets the CSS property value for the specified style. In this case, 'width'.n ",n "example": "n $('div').css('width', '200px'); // Sets the width of the first div on the page to 200 pixelsn $('div').css('width'); // Returns the CSS 'width' value for the first div on the page"n }n]

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More jQuery Interview Questions

How to divide a page into parts using jquery mobile? : jquery mobile

1 Answers  


Is jQuery a library for client scripting or server scripting?

1 Answers  


What are the browser related issues for jQuery?

1 Answers  


What is the difference between $('div') and $('<div/>') in jQuery?

1 Answers  


Do we need to add the jquery file both at the master page and content page as well?

1 Answers  


How to get the server response from an ajax request using jquery?

1 Answers  


What happen if you return false from a jQuery event handler?

1 Answers  


Back onto jquery ui' can you see jquery ui making more of an impression in the future, lead by the current successes of jquery?

1 Answers  


How can you add a jquery library in your project?

1 Answers  


How to get/set the html contents of an element using jQuery?

1 Answers  


What programming language does jquery use?

1 Answers  


How to programmatically trigger a click event thats being handled by jquery only?

1 Answers  


Categories