A few weeks back, I stumbled upon this code online that automates clicking the like button icon under a YouTube video.
likeButton = document.querySelector('#icon[alt^="like this"]').parentNode.parentNode.parentNode
likeButton.click();
However, YouTube has recently updated their user interface which led to this code not functioning anymore. Sadly, I didn't take the time to understand or research the code properly.
I am seeking assistance in comprehending the segment '#icon[alt^="like this"]'
,
Can someone explain what the alt^=
signifies and where I can find the icon named "like this"?
Thank you for your support!