0

change the inner html text of single id multiple plase, change at one line script

<!DOCTYPE html>
<html>
<body>

<p id="demo">click</p>
<p id="demo">Click</p>
<button onclick="myFunction()">Try it</button>

<script>
function myFunction() {
  document.getElementById("demo").innerHTML = "CHENGED";
}
</script>

</body>
</html> 

i won't to one click to all id text change

RAMU
  • 1
  • 1
  • You *probably* want to use a `class` instead of an `id` here. `id` is used to identify *one* element. – David Jan 18 '23 at 16:40

0 Answers0