Change text color,Link color,Background color and border color using Jquery keyup function.This is very simple jquery script.Use this script for your web applications.
Step 1:
Need library file to perform empty action.Please copy and Paste below library file.
<script src="http://code.jquery.com/jquery-1.7.2.min.js" type="text/javascript"></script>
jQuery keyup function
<script type="text/javascript" >
$(document).ready(function(){
$(".changecolor").keyup(function() //.Changecolor is selector
{
var text = $("#textcolor").val(); //get values using element id
$("#container").css("color", text); //Apply Css Styles
});
});
</script>
$(document).ready(function(){
$(".changecolor").keyup(function() //.Changecolor is selector
{
var text = $("#textcolor").val(); //get values using element id
$("#container").css("color", text); //Apply Css Styles
});
});
</script>
HTML Code
<form method="post" action="#">
<table width="400" border="0">
<tr>
<td>Change Text Color:</td>
<td><input type="text" class="changecolor" id="textcolor"/></td>
</tr>
</table>
</form>
<table width="400" border="0">
<tr>
<td>Change Text Color:</td>
<td><input type="text" class="changecolor" id="textcolor"/></td>
</tr>
</table>
</form>
No comments:
Post a Comment