function jinYong(){ var className=document.getElementById('jishuOuShuJinYong').className; console.log("className====="+className); var a = document.getElementById('jinYong'); //获取a元素对象 var aValue=a.innerText;//获取a标签文本内容 console.log("aValue===="+aValue); if(aValue=='禁用'){ a.innerHTML = "隐藏"; document.getElementById('jishuOuShuJinYong').className='form-inline'; }else{ a.innerHTML = "禁用"; document.getElementById('jishuOuShuJinYong').className='form-inline hide'; } }