click to show phonenumber on multiple hml files with multiple locations

I have 200 html files where I have to hide phone number until we click on a text, so I need to change all the files content using some tool like GrepWin. I can do that with this code but the problem is that the function name and id needs to be changed for all locations within the same page that have the same content. So this line is present several times on the same file:

 <p><b>Contact data: <script>function myFunction() {document.getElementById("demo").innerHTML = "0316 301 958";}</script><button id="demo" onclick="myFunction()">Show the number</button>
 <p><b>Contact data: <script>function myFunction() {document.getElementById("demo").innerHTML = "0316 301 958";}</script><button id="demo" onclick="myFunction()">Show the number</button>

I need different solution to change them all on all html files but to show the number(which is the same for all). At this point is only showing one number http://jsfiddle.net/qyzkfush/ . I can manually edit the function name and button id but it will take me ages to change 200 files content with many positions in each file. I need to use GrepWin to search the code and replace it for all files.

#javascript #html

1 Likes1.40 GEEK