I am using the following code for
1) Display the changed content in DIV container so if someone types in textbox it should simultaneously display the typed content
2) on selection of fonts, font should be applied to that content
" 强势 " 但它不能肯定我在做什么? " /强势 "
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Change Contents</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js"></script>
<script type="text/javascript" language="javascript">
$("#fs").change(function() {
alert($(this).val());
$( .changeMe ).css("font-family", $(this).val());
});
$("#size").change(function() {
$( .changeMe ).css("font-size", $(this).val() + "px");
});
</script>
</head>
<body>
<form id="myform">
<button>erase</button>
<select id="fs">
<option value="Arial">Arial</option>
<option value="Verdana ">Verdana </option>
<option value="Impact">Impact </option>
<option value="Comic Sans MS">Comic Sans MS</option>
</select>
<select id="size">
<option value="7">7</option>
<option value="10">10</option>
<option value="20">20</option>
<option value="30">30</option>
</select>
</form>
<br/>
<textarea class="changeMe">Text into textarea</textarea>
<div id="container" class="changeMe">
<div id="float">
<p>
Text into container
</p>
</div>
</div>
</body>
</html>