我有这个 HTML 代码:
<div id="switcher" >
<h3>Style Switcher</h3>
<button id="switcher-large">
Large Print
</button>
<br/> <br/>text
</div>
而这个jquery代码
$(document).ready(function() {
$('#switcher-large').bind('click', function() {
$('#switcher').addClass('large');
});
});
我有这个 CSS 样式
.large {
font-size: 2.5em;
}**strong text**
当我单击按钮时,我希望 div 中的文本变为 2.5em,但它没有按我的意愿工作。这是它的代码: