0

i have this problem where the setlikes() function doesnt work when i click the button. Any advice on how to fix it? HTML code:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<button onclick="setlikes()">likes</button>
<script src="content.js"></script>
</body>
</html> 

JS code:

function setlikes() {
    setInterval(likes(),100);
}
function likes(){
    var appBanners = document.getElementsByClassName('EDfFK ygqzn');

    for (var i = 0; i < appBanners.length; i ++) {
        appBanners[i].style.display = 'none';
        }
    };

0 Answers0