Copy link to clipboard
Copied
Hi, I have this code to bring a percentage automatically after the number :
if (event.value) event.value += "%";
What's the code to make it happen, but only if someone didn't write a percentage themselves in the first place ?
if (event.value && /%$/.test(event.value)==false) event.value += "%";
Copy link to clipboard
Copied
if (event.value && /%$/.test(event.value)==false) event.value += "%";