« She's a mystery to me | Main | Last resort for metacharacters »

February 18, 2010

JS to make one button the same size as another

var padme = $('m_butt').offsetWidth - $('sum_butt').offsetWidth;

// The 3 is the padding applied to the first element, 
// which needs to be added to the difference

$('sum_butt').style.paddingRight = (padme + 3) + 'px';

Tags: JavaScript

Posted by pj at February 18, 2010 09:45 AM

Comments