title: CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. How to fix it in html?
body: <p>I have created an HTML file, and there I have implemented a fetch request from Javascript. But is it saying <code>blocked by CORS policy</code>. How do I remove this error?</p>
  
  <p>My code:</p>
  
  <pre><code>    &lt;!DOCTYPE html&gt;
      &lt;html lang="en"&gt;
      &lt;head&gt;
          &lt;meta charset="UTF-8"&gt;
          &lt;!-- &lt;meta name="viewport" content="width-device-width ,initial-scale=1.0"&gt; --&gt;
          &lt;meta http-equiv="X-UA-Compatible" content="ie-edge"&gt;
  
          &lt;script src="https://code.jquery.com/jquery-3.5.0.js" integrity="sha256-r/AaFHrszJtwpe+tHyNi/XCfMxYpbsRg2Uqn0x3s2zc=" crossorigin="anonymous"&gt;&lt;/script&gt;
          &lt;title&gt;Document&lt;/title&gt;
  
          &lt;script type="text/javascript"&gt;
              fetch("http://ec2-13-233-168-148.ap-south-1.compute.amazonaws.com:8181/v1/youtube/detail?url=https://www.youtube.com/watch?v=FS9dkwhPypY").then(
  
                  res=&gt;{
                      res.json().then(
                          data=&gt;{
                              console.log(data.videoDetails.keywords.length);
                  console.log(data.videoDetails.thumbnail.thumbnails.length)           
  
  
                          })
                      });
  
          &lt;/script&gt;
  
      &lt;/head&gt;
      &lt;body&gt;
        &lt;div class="container"&gt;   
        &lt;table class="table table-stripped"&gt;
          &lt;thead&gt;
              &lt;tr&gt;
  
                  &lt;th&gt;Url&lt;/th&gt;
                  &lt;th&gt; height&lt;/th&gt;
              &lt;th&gt;width &lt;/th&gt;
              &lt;/tr&gt;
          &lt;/thead&gt;
  
          &lt;tbody id="th"&gt;&lt;/tbody&gt;
  
        &lt;/table&gt;
         &lt;table class="table table-stripped"&gt;
          &lt;thead&gt;
            &lt;tr&gt;
  
  
              &lt;th&gt;Keyword&lt;/th&gt;
            &lt;/tr&gt;
          &lt;/thead&gt;
          &lt;tbody id="data"&gt;&lt;/tbody&gt;
        &lt;/table&gt;
      &lt;/div&gt;
      &lt;/body&gt; 
      &lt;/html&gt;
  </code></pre>
  
  <p>My fetch request is not working in this condition. It says:</p>
  
  <pre><code>Access to fetch at 'http://ec2-13-233-168-148.ap-south-1.compute.amazonaws.com:8181/v1/youtube/detail?url=https://www.youtube.com/watch?v=FS9dkwhPypY' from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
  </code></pre>
  
  <p>How might I fix this issue ?</p>