Built with blockbuilder.org
Last active
August 15, 2018 17:38
-
-
Save jhnwllr/065366b8fef2947449e43a571143bc70 to your computer and use it in GitHub Desktop.
fresh block
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: mit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>val demo</title> | |
<style> | |
p { | |
color: red; | |
margin: 4px; | |
} | |
b { | |
color: blue; | |
} | |
</style> | |
<script src="https://code.jquery.com/jquery-1.10.2.js"></script> | |
</head> | |
<body> | |
<p></p> | |
<select id="multiple" multiple="multiple"> | |
<option selected="selected">Multiple</option> | |
<option>Multiple2</option> | |
<option selected="selected">Multiple3</option> | |
</select> | |
<script> | |
function displayVals() { | |
var multipleValues = $( "#multiple" ).val() || []; | |
$( "p" ).html(" <b>Multiple:</b> " + multipleValues.join( ", " ) ); | |
} | |
$( "select" ).change( displayVals ); | |
displayVals(); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment