Attaches a change event to the select that gets the text for each selected option and writes them in the div. It then triggers the event for the initial text draw.
!DOCTYPE html>
<html>
<head>
<style>
div { color:red; }
</style>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
</head>
<body>
<select name="garden" multiple="multiple">
<option>Flowers</option>
<option selected="selected">Shrubs</option>
...
Tuesday, 16 April 2013
Thursday, 11 April 2013
<SCRIPT language="javascript">
$(function(){
// add multiple select / deselect functionality
$("#selectall").click(function () {
$('.case').attr('checked', this.checked);
});
// if all checkbox are selected, check the selectall checkbox
// and viceversa
$(".case").click(function(){
if($(".case").length...
Wednesday, 10 April 2013
$('input[name="currentPage"]').attr('value',currentPage...
$("#whereToId").change(function () {
var str = "";
$("#whereToId option:selected").each(function () {
str += $(this).val() + " ";
});
alert(str);
})
.change()...
<!DOCTYPE html>
<html>
<head>
<style>
p { background:yellow; }
</style>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
</head>
<body>
<p>I would like to say: </p>
<div id="mydiv"></div>
<script>
$("p").append("<strong>Hello</strong>");
$("#mydiv").append("<p><strong>Hello</strong></p>");
</script>
</body>
</html>...
Subscribe to:
Posts (Atom)