#!/usr/bin/env js

function dblSize() {
    var pElements = document.getElementsByTagName('p');
    if (pElements.length === 0) {
        alert('何いってんの?');
    } else {
        for (let p of pElements) {
            var currentSize = window.getComputedStyle(p, null).getPropertyValue('font-size');
            var newSize = (parseInt(currentSize, 10) * 2) + 'px';
            p.style.fontSize = newSize;
        }
    }
}

document.addEventListener("DOMContentLoaded", function(e) {
    document.body.addEventListener("click", dblSize);
});
