정보 보관 ver1.0
.val()
James Wetzel
2012. 9. 10. 14:25
$('select.foo option:selected').val(); // get the value from a dropdown select $('select.foo').val(); // get the value from a dropdown select even easier $('input:checkbox:checked').val(); // get the value from a checked checkbox $('input:radio[name=bar]:checked').val(); // get the value from a set of radio buttons
<script>
$("button").click(function () {
var text = $(this).text();
$("input").val(text);
});
</script>
728x90
반응형