How to print one specific Javascript variable in HTML?

前端 未结 3 525
故里飘歌
故里飘歌 2021-01-25 16:51

I want to ask how I can print a Javascript variable in HTML form (e.g. output it on the screen)?

Here is my JS code:



        
3条回答
  •  遇见更好的自我
    2021-01-25 17:32

    Try this,

    your HTML

    
    

    js Script

    var howLongIsThis = myPlayer.duration();
    document.getElementById("logId").value=howLongIsThis;
    document.getElementById("logId1").innerHTML=howLongIsThis;
    

    hope this will give you an idea to solve your problem

提交回复
热议问题