JSFiddle - React, Tailwind, and code Playground

HTML

k

JavaScript

$(document).ready(function(){
    topwithpx='0px';
    alert(topwithpx);
    topstr=topwithpx.substr(0,topwithpx.length-2);
    alert(topstr);
    top=parseInt(topstr);
    alert(top);
});