[6][A.Thông điệp][slider-top-big][nothing]
You are here: Home / , How to show HTML while typing in textarea in Jquery

How to show HTML while typing in textarea in Jquery

| No comment
How to show HTML while typing in textarea in Jquery

Trong hướng dẫn này mình sẽ hướng dẫn bạn cách hiển thị mã HTML trong khi bạn đang nhập mã vào textarea :

Code load text :

<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js" type="text/javascript"></script>
</head>
<body>
<!-- http://www.erhay.com -->
<script>
    $(document).ready(function(){
        $('#textarea1').keyup(function() {
    $('#view1').html($(this).val());
});
    });
</script>
<textarea id="textarea1"></textarea>
<br/>
<div id="view1">
</div>
</body>
</html>

Demo : Mời bạn xem tại :

http://www.erhay.com/p/tao.html