DeVito Converter (Browser version)

Measure length in Danny DeVitos!

=

Use in Browser

External file

index.html

<h1>Hello World!
Danny DeVito is <span id="devitoHeight"></span> meters tall!</h1>

<script src="/path/to/devito.js"></script>
<script>
  var converter = new DannyDeVito();
  var span = document.getElementById(`devitoHeight`);

  span.innerHtml = converter.toMeters(1, 0);
</script>

Inline `<script>` tag

index.html

<h1>Hello World!
Danny DeVito is <span id="devitoHeight"></span> meters tall!</h1>

<script src="/path/to/devito.js"></script>
<script src="/path/to/your/script.js"></script>

script.js

var converter = new DannyDeVito();
var span = document.getElementById(`devitoHeight`);

span.innerHtml = converter.toMeters(1, 0);
Fork me on GitHub