一个css属性选择器的实际例子

<html>
<style>

div {
	color: blue;
}

[tabindex="0"]{
	color: red;
}


[tabindex="1"]{
	color: green;
}

[tabindex="2"]{
	color: yellow;
}

</style>
<script>
function clickme(){
	var oButton = getButton();
	var newAttribute = add();
	oButton.setAttribute("tabindex", newAttribute);
}

function getButton(){
	return document.getElementById("jerry");
}

function getNewCountFactory(){
	var counter = 1;
	return function(){
		return (counter++) % 3;
	};
}

var add = getNewCountFactory();
</script>
<button onclick="clickme()">Add</button>
<div>1</div>
<div id="jerry" tabindex="1">2</div>
</html>
上一篇:JetBrains系列软件设置


下一篇:SAP Spartacus Focusdirective继承自Lockdirective,静态代码分析