input选中 和 select点击下拉选择获取选中选项的值

1.input选中
$('#checkBox').find('input').each(function(i){ if($(this).prop('checked')){//获取是否选中 并判断 $(this).prop('checked', false); //修改设置为不选中状态 }else{ $(this).prop('checked', true);//修改设置为选中状态 } });
2.select点击下拉选择获取选中选项的值
$('#demo').change(function(){
    var con = $(this).html();
  $('#item').html(con);
  });
posted @ 2017-06-06 18:55  惊沙男孩  阅读(468)  评论(0编辑  收藏  举报