i need the result in a html paragraph
<p id="result">Here the Button Text</p>
This is the Html part
<button type="button" id="vteam">i need this text</button>
This is the JS part
$(document).on('click', '.vteam', function(event) {}
event.target
refers to the clicked element, so you can get the text inside it like so: event.target.innerText
.
I think you can use the following:
function changeText() {
document.getElementById("vteam").innerHTML = "Hello";
}
and
<p id="vteam" onclick="changeText()">I need this text to change</p>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With