<div class="input_wrapper">
  <div class="input_label">動画URL</div>
  <input type="text" class="movie_url">
</div>
<div class="submit mybutton">タイトル取得</div>
<div class="input_wrapper">
  <div class="input_label">リスト用タグ</div>
  <input type="text" class="movie_tag copy_target">
  <div class="text_copy mybutton">コピー</div>
</div>
<div class="input_wrapper">
  <div class="input_label">Tweetボタン用タグ</div>
  <input type="text" class="copy_target" value='<div class="levi-list-tweet"></div>'>
  <div class="text_copy mybutton">コピー</div>
</div>
<div class="input_wrapper">
  <div class="input_label">動画タイトル</div>
  <input type="text" class="movie_title copy_target">
  <div class="text_copy mybutton">コピー</div>
</div>
.input_wrapper {
  width:100%;
  text-align:center;
}
.input_label {
  margin:0 auto;
}

input[type=text] {
  width:90%;
  padding:.3em;
  border-radius:4px;
}

.mybutton{
  width:10em;
  text-align:center;
  margin:.2em auto 1em auto;
  padding:.2em;
  border-radius:4px;
  cursor:pointer;
}

.submit {
  color:white;
  background:crimson;  
}

.text_copy {
  color:white;
  background:darkgray;
}
jQuery(document).ready(function( $ ){
  var canTouch = 'ontouchstart' in window;
  var touchEvent = canTouch ? "touchend" : "click";
  
  // 取得ボタン
  $(document).on(touchEvent, ".submit", function () {
    movie_url = $(".movie_url").val();
    $(".movie_tag").val('<div data-url="'+movie_url+'" class="levi-list-play"></div>')
    if (movie_url == "") {
      return false;
    }
    $.ajax({
      url: "https://noembed.com/embed?url="+movie_url,
      type: "GET",
      dataType: "json",
      success: function(resp) {
        $(".movie_title").val(resp['title']);
        console.log('response : ', resp);
      },
      error: function(data) {
        console.error('error occured');
      }
    })
  });

  // コピーボタン
  $(document).on(touchEvent, ".text_copy", function () {
    $(this).parent().find('.copy_target').select();
    document.execCommand('copy');
  });

});

External CSS

  1. https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js