修改 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.如果过滤掉的话文章的格式就没有了。于 ......
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 ......