Quote:
Originally Posted by alphamale
string.replace(/\<(\/)*pre\>/g,"")
I dont get this, what are all the special characters for? Does it just remove all <pre> and </pre> tags?
and for: inputID.value = "<pre>" + inputID.value + "</pre>"
could I use $newText = "<pre>"".$oldText."</pre>";
?
Thanks!
|
I haven't tested it (not enough time, at work), but the extra characters (I assume you mean the backslashes) are for escaping, making the <, /, and > characters "literals" instead of programming commands.
It _should_ just remove the "<pre>" and "</pre>" tags from the string.
As far as $newText and whatnot, that looks like PHP, not JavaScript.