A simple demo of a live code sample

The example

This is a very simple example showing you how to do a live demo in MDN. For more information, see Live samples.

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

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

Note: On the localized pages, the value of the first parameter should be equal to the ID of the header that contains the sample.