0
A
回答
0
嘗試這個代碼,
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script src="../jquery-latest.js"></script>
<script>
$(document).ready(function(){
$("select").change(function() {
var str = "";
$("select option:selected").each(function() {
str += $(this).text() + " ";
});
$("div").text(str);
})
.change();
});
</script>
<style>
div { color:red; }
</style>
</head>
<body>
<select name="sweets" multiple="multiple">
<option>Chocolate</option>
<option selected="selected">Candy</option>
<option>Taffy</option>
<option selected="selected">Carmel</option>
<option>Fudge</option>
<option>Cookie</option>
</select>
<div></div>
</body>
</html>
3
$("input").change(function(){
// do something
});
Click here以獲取更多信息。
相關問題
- 1. Magento Contact Form change
- 2. javascript subscribe form change
- 3. Django Change Form FIlter
- 4. Symfony 2,form和jQuery on change提交
- 5. jquery select change event not posting form data
- 6. jQuery Cookie在保存FORM值時.Change()
- 7. Javascript anchor href change and form post
- 8. jQuery div change
- 9. Jquery .change()
- 10. jQuery select,.change和.click
- 11. 編輯任務工作流程FORM change
- 12. KnockoutJS binding change event to two or more form property
- 13. jQuery不觸發.change
- 14. jQuery .change不觸發
- 15. Jquery DatePicker dateformat change
- 16. jquery .change功能
- 17. jquery function .change()
- 18. Jquery change .prop href
- 19. jquery change onclick
- 20. Fieldset .change jQuery
- 21. jquery change not fire
- 22. JQuery的.change()
- 23. auto change div jquery
- 24. jQuery Field Change Submit not working
- 25. jQuery的.change()不觸發
- 26. jquery trigger('click')and on(change)
- 27. Aforge Blob Detection
- 28. Opencv Hole detection
- 29. Droid Incredible Headphones Detection
- 30. Apple watch standup detection