Tutorial :How to use this with JQuery


how do i use this code with jquery, i know it's easy but it doesn't work for me.





If your intention is to generate a new string where all <!-- and --> are removed then your code works just fine. If not then you probably should be reminded that in javascript, a String's replace() method does not replace anything in that string, it generates a new string. So:

var html = document.getElementsByTagName('html')[0];  html.innerHTML = html.innerHTML.replace(/<!--|-->/g,'');  

But your question is very odd. Why would you want to do this? Perhaps you want to uncomment some commented out code? This does not look like something that is safe to do.


This should work for you. Remember you can use javascript and jQuery together. Try this:


Probably not the most elegant solution, but should work. Are you familiar with:


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »