Не видит файл .js из html
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css"
integrity="sha512-iBBXm8fW90+nuLcSKlbmrPcLa0OT92xO1BIsZ+ywDWZCvqsWgccV3gFoRBv0z+8dLJgyAHIhR35VZc2oM/gI1w=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="style.css">
<title>JS Music Player</title>
</head>
<body>
<h1>Music Player</h1>
<div class="music-container play" id="music-container">
<div class="music-info">
<h4 id="title">ukulele</h4>
<div class="progress-container" id="progress-container">
<div class="progress" id="progress"></div>
</div>
</div>
<audio src="music/nazare.mp3" id="audio"></audio>
<div class="img-container">
<img src="img/nazare.jpg" alt="music-cover" id="cover"/>
</div>
<div class="navigation">
<button id="prev" class="action-btn">
<i class="fas fa-backward"></i>
</button>
<button id="play" class="action-btn action-btn-big">
<i class="fas fa-play"></i>
</button>
<button id="next" class="action-btn">
<i class="fas fa-forward"></i>
</button>
</div>
</div>
<script>src="app.js"
console.log('1stranica')
</script>
</body>
</html>
app.js
console.log() уже не видит...
console.log('hurma!!!!!!!!!!!!!!')
const musicContainer = document.getElementById('music-container')
const playBtn = document.getElementById('play');
const prevBtn = document.getElementById('prev');
const nextBtn = document.getElementById('next');
const audio = document.getElementById('audio');
const progress = document.getElementById('progress');
const progressContainer = document.getElementById('progress-container');
const title = document.getElementById('title');
const cover = document.getElementById('cover');
//Song Titles
const songs = ['gospel','search','nazare'];
// Keep track of song
let songIndex = 1;
//Load song details into DOM
loadSong(songs[songIndex]);
//Update song details
function loadSong(song){
title.innerText = song;
audio.src = `music/${song}.mp3`;
cover.src = `img/${song}.jpg`;
}
Ответы (1 шт):
Автор решения: Igor
→ Ссылка
Не
<script>src="app.js"
console.log('1stranica')
</script>
a
<script src="app.js"></script>