These are my codes:
a.html
<div class="pic-box">
<img src="a.jpg" alt="" />
</div>
index.html
<div class="get-box"></div>
index.js
const pageUrl = './pages/a.html',
fetch(url).then(function(response){
if (response.ok) {
return response.text();
}
}).then((data) => {
$('.get-box').html(data);
const imageHeight = $('.get-box img').height();
console.log(imageHeight);
});
I want to get the height of the image, but it showes me it 0. How could I get the true height?