0
I have no clue how to do this
I have no experience with jQuery but have only found ways to do something similar to this using it, but I need help with centering the button, and making it replace the first h2 and p but having it keep the padding and border along with color, alignment etc. I also don't know if anyone will know how to do this so here's a challenge, idc what language it's in. https://code.sololearn.com/WVwp0Xysq1V7/?ref=app
3 Respuestas
+ 1
I realize I never updated the code since I figured it out so here
https://code.sololearn.com/WVwp0Xysq1V7/?ref=app
+ 1
//You can use simple html tag <center> to centre button
<center>
<button>Replace the first p element with new text</button>
</center>
//Here is a solved on including jquer problem
https://code.sololearn.com/W7hGLZ53Gixm/?ref=app
0
ok added that
https://code.sololearn.com/WVwp0Xysq1V7/?ref=app
I actually figured it out by just using java like this
<!DOCTYPE html>
<html>
<style>
h2 {
color: blue;
}
</style>
<body>
<h2 id="demo">Click the button to change the text in this paragraph.</h2>
<button onclick="myFunction()">Try it</button>
<script>
function myFunction() {
document.getElementById("demo").innerHTML = "Hello World";
}
</script>
</body>
</html>