html中获取class属性值、修改属性值

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';
	 }
}

  

posted @ 2022-05-05 17:06  红尘沙漏  阅读(732)  评论(0编辑  收藏  举报