For some reason this is not working, yet all my searches say it should work.
I have an id on an element where I am trying to increment the value by 1.
so let’s say I have
<input id="someText1">
I want to change the 1 to a 2, so I end up with
<input id="someText2">
I’ve tried to match just the text using
text = $("input").attr("id").match(/^[a-zA-Z]+$/);
But when I output the value of text, I get null
Please help!
Remove the
$sign (the text does end with a number and you’re telling it that it ends with a letter)