问题
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'> ▾</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