How can I use jquery on the client side to substring "nameGorge" and remove "name" so it outputs just "Gorge"?
var name = "nameGorge"; //output Gorge
No jQuery needed! Just use the substring method:
var gorge = name.substring(4);
Or if the text you want to remove isn't static:
var name = 'nameGorge'; var toRemove = 'name'; var gorge = name.replace(toRemove,'');
2.1m questions
2.1m answers
60 comments
56.9k users