Converting jQuery to vanilla JavaScript

How would I remove jQuery from this code and have pure JavaScript?


jQuery(document).ready(function () {
  jQuery(".button a").click(function () {
    var pxValue = jQuery("#pixel").val();
    var vpwidth = jQuery("#vpwidth").val();
    var vwValue = parseFloat(pxValue / vpwidth) * 100;
    vwValue = vwValue + "vw";
    jQuery(".output label").text(vwValue);

There are some online guides that could help, like this or this or this.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.