When I change the font of the button font, the size will also be resized. My problem is that I cannot give the button a predefined size, so I tried to fix it with.css('width','-=4px');
But that will not work. Hope someone can help me.
HTML
<input id="b1" type="button" value="Hello world" />
<input id="b2" type="button" value="Blubba blib" />
<input id="b3" type="button" value="Bl" />
<input id="b4" type="button" value="Blubba 55" />
Js
$('input:button').click(function() {
$('*').css('font-weight','normal');
$(this).css('font-weight','bold');
$(this).css('width','-=4px');
});
Exmaple
http://www.jsfiddle.net/V9Euk/618/
Thanks in advance! Peter
Peter source
share