在Ext中,这样的下拉框怎么写?

解决方案 »

  1.   

    <div style='width:150px; height:20px;'>
    <div style='width:100px; height:20px; float:left;'>
    <input type='text' style='width:100px' id='num'/>
    </div>
    <div style='width:50px; height:20px; float:left;'>
    <input type='button' style='height:10px; display:block;' value='<' onclick='add()' />
    <input type='button' style='height:10px; display:block;' value='>' onclick='reduce()'/>
    </div>
    </div><script>
    var n = document.getElementById('num');
    function add()
    {
        n.value = isNaN(n.value) ? 1 : ++n.value;
    }function reduce()
    {
    n.value = isNaN(n.value) ? 1 : --n.value;
    }
    </script>