我的代码如下所示,我在文本框中输入一些内容,然后将下拉菜单更改为大写等,一切正常,但是当我从下拉菜单中选择“小写字母”时没有任何反应,我尝试将下拉属性更改为变体,但它仍然没有工作,不知道是什么问题
<!DOCTYPE html>
<html>
<head>
<title> - test </title>
<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script>
<script type='text/javascript'>
$(window).load(function(){
$('#ta1').keyup(function(){
$('#float1').html("<p>"+$(this).val()+"</p>");
});
$("#size").change(function() {
$('#float1').css("text-transform", $(this).val());
});
});
</script>
</head>
<body>
<form id="myform">
<label>Font Style</label>
<select id="size" >
<option value="0">[No Engraving]</option>
<option value="variant">Small Caps</option>
<option value="uppercase">All Caps</option>
<option value=" lowercase">No Caps</option>
<option value="capitalize">Normal</option>
</select>
</p>
</form>
<p>
<label>Top Leg
<input type="text" name="top_leg" id="ta1" class="changeMe" maxlength="10">(10 char, $1)
</label>
</p>
<p>
<label></label>
</p>
<!--Start top leg Div-->
<div id="container" class="changeMe2" style=" left: 298px;
position: absolute;
top: 287px;
z-index: 999;">
<div id="float1">
<p>
</p>
</div>
</div>
<!--Stop top leg Div-->
</html>
<div>
</body>