Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery, get width of one element and apply to another

Tags:

jquery

Is there a way that I can get the width of one element .container for example and apply it to another .item for example?

My layout is responsive, hence why I can't just give .item a fixed width value.

like image 909
Dean Elliott Avatar asked Dec 12 '22 14:12

Dean Elliott


1 Answers

Like this -

$('.item').width($('.container').width());

Demo ----> http://jsfiddle.net/xQ7hh/

like image 102
Mohammad Adil Avatar answered Jan 12 '23 15:01

Mohammad Adil