How do I change the font of a javascript variable?

前端 未结 3 1235
有刺的猬
有刺的猬 2021-01-24 06:05

I am trying to make a game similar to cookie clicker. This is part of my code:

3条回答
  •  失恋的感觉
    2021-01-24 06:41

    You can add a function that is called on click which can update your css. Try this

    
    
    
     function myFunction()
        {
            document.getElementById('clickCount').setAttribute("class", "style1");
        }
    

    Here is some more info on .setAttribue: https://developer.mozilla.org/en-US/docs/Web/API/Element/setAttribute

提交回复
热议问题