[removed] not working for me?

前端 未结 8 1956
栀梦
栀梦 2021-02-07 14:17

Well I\'m simply playing around with a userscript of GreaseMonkey and here\'s just something simple I attempt to do;

function test() {
document.getElementById(\'         


        
8条回答
  •  难免孤独
    2021-02-07 14:47

    Maybe do this:

    
    

    Or is that not what you're looking for? If you want to do it without the HTML bit above, maybe try and replace document with window:

    window.onload = function ()
    {
       document.getElementById('elementhere').innerHTML = 'test';
    } 
    

    I would give that a go because of this:

    window.onload vs document.onload

    I know that posting a link to a link is lame, but you will see why I did that (hopefully).

    Cheers!

提交回复
热议问题