Access to XMLHttpRequest at from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. code example
Example: javascript access to xmlhttprequest at from origin 'null' has been blocked by cors policy
//Open the HTML file using live server, it will work