Insert audio command?

  • 0
    Is there a command to insert audio? Found only on the insert image
    document.execCommand("insertImage", false, "image.png");
    JavaScript Anonymous, Apr 10, 2020

  • 1 Answers
  • 0
    Don't use this method, surprisingly execCommand still works.

    In order to add any element (wtch audio) to the document, you need to run the following commands:

    let audio = document.createElement('audio') // Создаём
    document.body.appendChild(audio) // Добавляем в body или другое место

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!