"Parsing" I think is the word.

Posted by Anonymous the Great on Stack Overflow See other posts from Stack Overflow or by Anonymous the Great
Published on 2010-06-11T03:07:20Z Indexed on 2010/06/11 3:13 UTC
Read the original article Hit count: 185

Filed under:
|
|

I'm working on a little parsing thing to color objects. For an example, you could type red:Hi!: and "Hi!" would be red.

This is my not working code:

<script type="text/javascript">
function post()
{
    var preview = document.getElementById("preview");
    var submit = document.getElementById("post");
    var text = submit.value;
    <?php str_replace("red:*:",'<i class="red">*</i>',text); ?>
    preview.value = text;
}
</script>

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about parsing