JavaScript button

On this page by default there is no button. If the button only works with JavaScript why not show it only when JavaScript runs.

Show button if JavaScript is available

Source code


<form>
  <fieldset>
    <p>Show button if JavaScript is available</p>
    <div id="jsknop"></div>
  </fieldset>
</form>

<!-- JavaScript -->
<script type="text/javascript">
  var insertbutton = document.getElementById("jsknop");
  if (insertbutton) {
    var scriptStyles = document.createElement("button");
    var scriptText = document.createTextNode("Send");
    scriptStyles.type = "submit";
    scriptStyles.appendChild(scriptText );
    insertbutton.appendChild(scriptStyles);
  };
</script>