修改 html 标签属性
修改 checked 属性
var sex = '${entity.sex}';
if(sex == '男')
{
//document.all.sexCk1.checked=true; 这种火狐不支持
document.getElementById('sexCk1').checked = true;
document.getElementById('sexCk2').checked = false;
}else if(sex == '女'){
document.getElementById('sexCk1').checked = false;
document.getElementById('sexCk2').checked = true;
}
修改 class 属性
// 处理课程进度
var progress = '<s:property value="progress" /> ';
//alert(' progress :'+progress);
if(progress >= 1){
document.getElementById('javase').className = 'passed';
}
if(progress >= 2){
document.getElementById('web').className = 'passed';
}
if(progress >= 3){
&nb
相关文档:
有时页面需要获得用户浏览器的高度才能确定内容显示在哪里,代码
<div style="position:absolute; left:0; top:expression(document.body.clientHeight/2-document.body.clientHeight/4)">
</div>
中,expression(document.body.clientHeight/2)即为获得浏览器高度再除以2 ......
最近在弄公司的系统时遇到一个问题,有一个winform要调用网站的数据库,数据库中存的是经过eWebEditor处理过的文章,都带有html标签,当时想用正则表达式过滤掉,但是还是放弃了原因有三:1.我对正则表达式了解很少;2.虽说我可以现学正则表达式,但是实现起来也是很麻烦的;3.如果过滤掉的话文章的格式就没有了。于 ......
<map name="Map4" id="Map4">
<area shape="rect" mce_shape="rect" coords="659,31,697,45" mce_coords="659,31,697,45" href="product/?keys=289" mce_href="product/?keys=289" />
</map>
<map name=" ......
转载:http://jiangzhengjun.javaeye.com/blog/480996
事件
DOM同时支持两种事件模式:捕获型事件和冒泡型事件,但是,捕获型事件先发生。两种事件流会触及DOM中的所有对象,从document对象开
始,也在document对象结束(大部分兼容标准的浏览会继续将事件捕获/冒泡延续至window对象),DOM中的元素都会连续收到两次事 ......
Example:
1.<!--[if !IE]><!--> 除IE外都可识别 <!--<![endif]-->
2.<!--[if IE]> 所有的IE可识别 <![endif]-->
3.<!--[if IE 5.0]> 只有IE5.0可以识别 <![endif]-->
4.<!--[if IE 5]> 仅IE5.0与IE5.5可以识别 <![endif]-->
5.<!--[if gt IE 5.0]> IE ......