tags:

views:

14

answers:

1

i using SyntaxHighlighter and i have an text area

<textarea id="content" onchange="perview();"></textarea>

and

function perview() {
var code = $("textarea#content").val();
$('#code-preview').html(code);
}   

and

<pre id="code-preview" class="brush: php;"></pre>

and i started the highlightrt

SyntaxHighlighter.all();

but when typing there is no any change happing just there is an Highlighter has no text

A: 

This does work on my system.

<script>
    $(document).ready(function() {
        $('#content').keyup(function() {
            var code = $('#content').val();
            $('#code-preview').html(code);
        });
    });

</script>

<textarea cols="10" id="content"></textarea>
<pre id="code-preview"></pre>
griegs
not working my dear
moustafa