K
K
krispey1022021-06-23 11:49:19
JavaScript
krispey102, 2021-06-23 11:49:19

How to display a variable in a variable?

There is a code

var txt = содержит название ссылки
 var video =
        '        <div class="snippet">\n' +
        '          <div class="stage">\n' +
        '            <div class="dot-flashing"></div>\n' +
        '          </div>\n' +
        '        </div>\n' +
        '<video id=video5 width=600 height=300 class="video-js vjs-default-skin" placeinline>\n' +
        '    <source src='"https://youtube.com/..." type="application/x-mpegURL">\n' +
        '</video>';

how to display a txt variable instead of a link?
example to be
'    <source src='"txt." type="application/x-mpegURL">\n' +

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
WapSter, 2021-06-23
@krispey102

Example https://codepen.io/wapster92/pen/qBrzqjq

S
Sergey, 2021-06-23
@sslion

'    <source src='"${txt}." type="application/x-mpegURL">\n' +

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question