Filed under

Javascript

Entries from across the notebook, collected around this topic.

Explore this sectionAbout the author & following the notebook

The feed 9 entries

RSS feed
  1. Status

    Love these interactive articles, and this one is by far the best on explaining …

    Cavallino-Treporti, Italy

    Love these interactive articles, and this one is by far the best on explaining how to recreate Apple’s new Liquid Glass UI in the browser. Liquid Glass in the Browser: Refraction with CSS and SVG

  2. Status

    Most developers when using HTML inputs with type="number" assume the input value …

    Cavallino-Treporti, Italy

    Most developers when using HTML inputs with type="number" assume the input value will be a number, and get confused when the value is a string instead. This is because the type=“number” actually tells the browser that the input is used for numbers and to provide a number input UI with included built-in validation to reject non-numerical entries.

    Now to get the number almost everyone will use the good old parser functions parseInt/parseFloat, like this:

    parseInt(input.value, 10);
    

    But, there is a less-known property called .valueAsNumber which allows us to avoid parseInt/parseFloat functions, for example:

    input.valueAsNumber
    

    How cool is that!