I found this code on another question, but am not sure how to use it:
var text = document.getElementById("text").innerHTML; text = text.replace(/"z"/g, function(n){ return ++n }); document.write(text);It's exactly what I need, but I'm not sure how to pass a number to the function. Essentially, I have a large list of csv (comma delimited) items and need to look for each occurrence of "z" and replace it with a number incremented by one. The code is here, but I'm just not knowledgeable yet to know how to use it.
I've placed my text witch needs to be replaced inside of a div with an id of text. Any ideas?