且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

更改CSS属性与jQuery

更新时间:2022-10-21 22:21:49

 的jQuery(身体),CSS({字体:'5em的'});

Today I was shown a really simple way to change the font-size of an element using jQuery. It looked very similar to the following:

<script  type="text/javascript">
    jQuery(document.body) ({font-size:5em;});
</script>

This obviously doesn't work, but I was wondering what's missing? I remember it being just one line of code.

Note: I have tried jQuery(document.body).css({font-size:5em;}); as well, without success.

Thanks.

jQuery('body').css({fontSize:'5em'});