<script type="text/javascript">
$(function(){
$("img").click(function(){
$("#score").val($(this)[0].title);
var len = $(this).prevAll('img').length;
$("img").each(function(i,obj){
if(i<=len) obj.src="images/roses.png";
});
});
});
</script>
<body>
请è¯åï¼
<img src="images/rose.png" width="" height="" border="0" title="1å">
<img src="images/rose.png" width="" height="" border="0" title="2å">
<img src="images/rose.png" width="" height="" border="0" title="3å">
<img src="images/rose.png" width="" height="" border="0" title="4å">
<img src="images/rose.png" width="" height="" border="0" title="5å">
<br><br><input type="text" name="" id="score" />
</body>
ç®ååäºä¸ ä½ å¯ä»¥è¯ä¸ææ
温馨提示:答案为网友推荐,仅供参考