<input id="username" class="font_chara {required:true,messages:{}}">
<button onclick='onClick()'>Try</button>
<script>
function onClick() {
x = document.getElementById('username');
x.value = '123';
alert(x.getAttribute('class'));
}
</script>
多个类名用空格分隔。{required:true,messages:{}}疑似jQuery用的JSON数据,它要split下?有懂得给说说?
--
修改:billybear04 FROM 106.121.160.*
FROM 106.121.160.*