个人笔记
css3新增的属性选择器
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>css中属性选择器</title>
<script type="text/javascript" src="index.js"></script>
<style>
[id*=section]{
background-color: red;
}/*含有section*/
[id^=al]{
background-color: blue;
}/*开头为al*/
[id$=ss]{
background-color: green;
}/*结尾为ss*/
</style>
</head>
<body>
<div id="section1">section1</div>
<div id="section2">section2</div>
<div id="alsl">alsl</div>
<div id="albl">albl</div>
<div id="aclass">aclass</div>
<div id="bclass">bclass</div>
</body>
</html>
storage储存JS代码
function saveStorage(id){
var target=document.getElementById(id);
var str=target.value;
sessionStorage.setItem("mess",str);
}function loadStorage(id){
var target=document.getElementById(id);
var msg=sessionStorage.getItem("mess")
target.innerHTML=msg;
}