Reputation: 69
<head>
<style>
img {
opacity: 0.5;
}
</style>
</head>
This is a part of my HTML file. How do I change the value of the opacity using JavaScript?
Upvotes: 1
Views: 54
Reputation: 3483
you can use style
like:
var imgs = document.querySelectorAll("img");
for(let i = 0; i < imgs.length; i++){
imgs[i].style.opacity = 1
}
Upvotes: 5