除了在option中定义属性selected = "selected",还可以

<select defaultValue='2'>
<option value="0">美国队长</option>
<option value="1">天启</option>
<option value="2">大鱼海棠</option>
</select>

HTML - SELECT默认选中的更多相关文章

  1. jQuery 设置select默认选中问题

    在进行其他操作后,恢复select默认选中 html代码: <select id="shai" style="width:150px;margin:5px 50px ...

  2. struts2设置<s:select>默认选中项的方法

    struts2的select标签中,常用的有以下几个属性:(1)struts2中的select 标签中,必须设置的属性只有一个,即是list.(2)select标签的list中必须有值,不然会报错.如 ...

  3. struts2 select 默认选中

    jsp: <s:select list="#{'1':'男','2':'女'}" name="sex"/> action: private Stri ...

  4. js获取select默认选中的Option (非当前选中值)

    js函数方法: <script> function getDefaultSelectedOption(selectId, valIfNull) { var selectId = selec ...

  5. <select> 默认选中

    不多bb,直接上代码 html代码: <li><span>所属类别</span> <select id="cate" name=" ...

  6. select默认选中项颜色为灰色,选择后变为黑色(js实现)

    <script> var unSelected = "#999"; var selected = "#333"; $(function () { $ ...

  7. 解决设置select默认选中不生效的方法

    $scope.storageTypeList = ['Glusterfs','NFS','Ceph']; 不生效的方法: <select class="form-control&quo ...

  8. Vue select默认选中第一个

    <td> <select v-model="selectWare"> <option selected="selected" va ...

  9. select默认选中

随机推荐

  1. Postfix接收邮件后转向运行特定的脚本

    本文主要參考:http://serverfault.com/questions/258469/how-to-configure-postfix-to-pipe-all-incoming-email-t ...

  2. easyui refresh 刷新两次的解决方法(推荐)

    //这样写刷新两次 $("#windowid").window('refresh','url01.php'); $("#windowid").window('o ...

  3. redis学习笔记——主从同步(复制)

    在Redis中,用户可以通过执行SLAVEOF命令或者设置slaveof选项,让一个服务器去复制(replicate)另一个服务器,我们称呼被复制的服务器为主服务器(master),而对主服务器进行复 ...

  4. redis 超时失效key 的监听触发

    1. 事件通过 Redis 的订阅与发布功能(pub/sub)来进行分发,故需要订 阅 __keyevent@0__:expired 通道 0表示db0 根据自己的dbindex选择合适的数字 2.  ...

  5. springboot项目打包提示Unable to find a single main class from the following candidates错误

    提示Unable to find a single main class from the following candidates错误的原因是会从所有代码里面扫描包括main方法的类,找到多个类就报 ...

  6. Strange Addition

    http://codeforces.com/problemset/problem/305/A 这题就是意思没看懂,一开始以为只要个位数只要一个为0就能相加,没想到到CF里面提交第三组就过不了,才发现是 ...

  7. win7官方下载地址

    win7官方下载地址 http://microsoftstore.me/category/microsoft/windows/

  8. EXCEPTION-JS

      CreateTime--2016年11月22日13:00:55Author:Marydon 声明:异常类文章主要是记录了我遇到的异常信息及解决方案,解决方案大部分都是百度解决的,(这里只是针对我遇 ...

  9. 〖Android〗/system/etc/audio_policy.conf

    原文件注释说明: # audio hardware module section: contains descriptors for all audio hw modules present on t ...

  10. Java 爬虫(获取指定页面中所有的邮箱地址)

    import java.io.BufferedReader;import java.io.FileReader;import java.io.IOException;import java.io.In ...