Sunday, 23 September 2012

live word preview using jquery

// siddhu vydyabhushana // 3 comments
am sure that this post can really motivate to develop projects.
in my last posts i taught u about jquery functions. present i used keyup()  function, html()





1.JQUERY CODE:


<script type="text/javascript" src="http://ajax.googleapis.com/ajax/
libs/jquery/1.3.0/jquery.min.js"></script>
<style>
input
{
width:300px;
height:50px;
}
</style>
<script>
$(function()
{
$('.username').keyup(function()
{
var username=$(this).val();

if(username!='')

$('.check').html(username);

});
});
</script>

2.  HTML CODE:

<body>
<input type="text" name="username" class="username"><bR><span class="check" style="color:red;" >-------------</span>@aitamelearning.blogspot.com.
</body>

3 comments: