Can you make a javascript function replace itself on the page with custom html?

后端 未结 4 1374
无人及你
无人及你 2021-01-13 18:42

I have some javascript which will create some sort of widget on a page. I will be giving this snippet to clients so I want them to have to do very little.

The most o

4条回答
  •  难免孤独
    2021-01-13 18:58

    So you want to have a script element which replaces itself with div.

    Your initial code is like this:

    You can rewrite it like this (I am using JQuery):

    
    

    I have not tried it though!

提交回复
热议问题