Set charset meta tag with JavaScript

后端 未结 3 1504
再見小時候
再見小時候 2021-01-07 22:14

There\'s a bug I\'m trying to track down here: https://github.com/OscarGodson/EpicEditor/issues/184#issuecomment-8805982

Based on all the information it seems

3条回答
  •  -上瘾入骨i
    2021-01-07 22:57

    I agree with both @alohci and @sebastien-lorber answers.

    But just addressing your orginal issue with just getting

    
    

    using the setAttribute method

    charsetMetaTag.setAttribute("charset", "UTF-8");
    

    and following @sebastien-lorber suggestion, will output

    
    

    as first child element of head

提交回复
热议问题