Form elements that aren't styleable

南楼画角 提交于 2020-01-15 12:03:57

问题


Here is the fiddle. I am making custom form elements that aren't styleable. I am wondering what form elements aren't styleable so I can create them a custom one.

Current JS/JQuery:

$(document).ready(function () {
    $('ol').hide();
    $('#click').click(function () {
        $(this).toggleClass('down');
        $('ol').toggle();
        $('.l').click(function () {
            var l = $(this).html();
            $('#click').html(l + ' ▾');
        });
    });
});

HTML:

<div id='click'> &blacktriangledown;</div>
<div id='list'>
    <ol>
        <li class='l'>Hello</li>
        <li class='l'>Hola</li>
        <li class='l'>Bonjour</li>
    </ol>
</div>

(This question is useful for people doing the same thing I am.)


回答1:


Form elements that are not completely syllable are:

  • input[type=checkbox]
  • input[type=radio]
  • input[type=file]
  • input[type=color]
  • input[type=date]
  • input[type=datetime]
  • input[type=datetime-local]
  • input[type=time]
  • input[type=month]
  • input[type=week]
  • select
  • select[multiple]

Form elements that require browser specific styling:

  • input[type=seach]
  • input[type=number]

Also note, there are plugins and workarounds for styling/replacing all of these already, and they are pretty good. If you plan on replacing these, you need to remember keyboard controls and ARIA attributes for people with disabilities.



来源:https://stackoverflow.com/questions/18626205/form-elements-that-arent-styleable

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!