html label-标签

input

/**
 * input label
 *     http://www.w3school.com.cn/tags/tag_input.asp
 */
function testInputLabel(){
    debugger;
    var inputLabel = document.getElementById("inputElm");
    console.log(inputLabel.value);
}

select

<div>
    <select id="deviceSel" title="列表" class="select-label-style0">
    <option value="v01">s01</option>
    <option value="v02">s02</option>
    <option value="v03">s03</option>
    </select>
</div>

var deviceSel = document.getElementById("deviceSel");

/**
 * selcet label
 *     http://www.w3school.com.cn/tags/tag_input.asp
 */
function testSelectLabel() {
    debugger;
    console.log(deviceSel.selectedIndex);    // index
    console.log(deviceSel.value);            // value
    console.log(deviceSel.childNodes[1].innerText);    // s03
}

 

posted @ 2017-10-09 00:08  zhen-Android  阅读(316)  评论(0编辑  收藏  举报