A simple example of a live code demo in MDN

The example

This is a very simple example showing you how to do a live demo in MDN. For more information, see "Using the live sample system" in the editor guide.

<form>
  <label>Try me<input type="text" name="name"></label>
  <input type="submit" value="go">
</form>
form {
  border-radius: 10px;
  background: powderblue;
}
var f = document.querySelector('form');

f.addEventListener('submit', function(ev) {
  ev.preventDefault();
  document.querySelectorAll('input')[1].value = 'sending';
}, false);

 

Document Tags and Contributors

Contributors to this page: Sheppy, codepo8
Last updated by: Sheppy,