I made a post last night about centering the text and the button itself and I appreciate getting great feedback that solved the problem. Now I'm having a different issue, the button wont function on mobile for some reason? It was working fine last night when I tested it out but just now when I tried to apply it on another page it wasn't functioning on mobile. The button appears on mobile but it just wont do anything upon clicking it. There's no issue like this on desktop though, so I'm a bit confused. I'll paste the entire code below.
Take a look and see if you can help,
Thanks.`
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
#more {display: none;}
</style>
</head>
<body>
<span id="dots"></span><span id="more" style=color:black;>Example Text</span></p>
<div style="text-align:center"> <button onclick="myFunction()" id="myBtn" style=color:white;background-color:black;>Lyrics</button></div>
<script>
function myFunction() {
var dots = document.getElementById("dots");
var moreText = document.getElementById("more");
var btnText = document.getElementById("myBtn");
if (dots.style.display === "none") {
dots.style.display = "inline";
btnText.innerHTML = "Lyrics";
moreText.style.display = "none";
} else {
dots.style.display = "none";
btnText.innerHTML = "Read less";
moreText.style.display = "block";
moreText.style.textAlign = "center";
// btnText.parentElement.style.textAlign = "center";
}
}
</script>
</body>
</html>
`