Changing text of sticky post banner using JavaScript
-
I’ve been trying to change the text of the Sticky Post banner on the website below using JavaScript and jQuery, but I can’t seem to get anything to work.
https://www.showyourhumanity.org/
I’ve tried the below examples. They seem to work when I use other online editors using both IDs and Classes using different variations of the class name and adding or removing the “.” before the class name.
[ Moderator note: code fixed. Please wrap code in the backtick character or use the code button. ]
<script> document.getElementsByClassName("sticky-badge").innerHTML = "SYH News"; </script>
$(.sticky-badge).html("SYH News");
Is there something I’m missing?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Changing text of sticky post banner using JavaScript’ is closed to new replies.