cedrick masson
cedrick masson

Reputation: 23

Remove a attribute(hidden) in a html with a function

Hi i have a question for you i will remove a attribute (Hidden) whit a Input type button can you help me this is my script

tanks for your help

<input type="button" onclick="myfunction()" value="Test">
<hr>
<button id="ici" hidden="">lol</button>

<script>
function myfunction() {
  document.getElementById("ici").removeAttribute("hidden");
}
</script>

Upvotes: 1

Views: 86

Answers (1)

DCR
DCR

Reputation: 15657

what's not working?

function myfunction() {
  document.getElementById("ici").removeAttribute("hidden");
}
<input type="button" onclick="myfunction()" value="Test">
<hr>
<button id="ici" hidden=''>lol</button>

Upvotes: 1

Related Questions