0

I want to replace some words like "php", because when I put PHP code in HTML tags the codes are hiding.

Entered PHP code gets hidden when inside an HTML tag

$('#editor').contents().find('<?php').replaceWith('');

or something like this:

$('#editor').contents().find('body').html().replace('<?php', '');

this is my code :

var myEditor = function(Tag){
        if (document.selection){
            var range = myIFrame.selection.createRange();
            range.pasteHTML("<" + Tag + ">" + range + "</" + Tag + ">");

        }else if(document.getSelection){
            var range = myIFrame.getSelection().getRangeAt(0);
            var nnode = myIFrame.createElement(Tag);
                range.surroundContents(nnode);
                nnode.innerHTML = range;
        }
    }
Taryn
  • 242,637
  • 56
  • 362
  • 405
Mohsen TOA
  • 759
  • 10
  • 17

0 Answers0