js改变字体

JavaScript010

js改变字体,第1张

link.onmouseover = function(){

    if(!this.font){

        var font = this.currentStyle ? this.currentStyle.font : getComputedStyle(this, false).font

        this.font = font

    }

    this.style.font = "bolder 22px consolas"

}

link.onmouseout = function(){

    this.style.font = this.font

}

function Fontface1(face1){

var Divs=document.getElementById('booktext')

if(Divs!=null){

Divs.style.fontFamily=face1

}

}

请注意F需要大写~~

js是区分大小写的~~