原生Js获取某个节点后面的第一个标签
2024-08-26 00:55:23
nextSlbling属性 获取某个节点后面的第一个节点(可能是标签 文本)
判断获取的节点是否为标签节点还是文本节点
window.onload=function(){
var pagecount={$page_count};
document.getElementById('firsts').setAttribute('class','disabled');
document.getElementById('before').setAttribute('class','disabled');
var current=document.getElementById('before').nextSibling;
while(current.nodeType != 1){ 根据nodeType判断节点属性
current=current.nextSibling;
}
current.setAttribute('class','current');
if(pagecount==1){
document.getElementById('next').setAttribute('class','disabled');
document.getElementById('last').setAttribute('class','disabled');
}
}
最新文章
- svn 版本转为git
- hibernate的映射类型
- 关于IIS部署时出现“System.Data.OracleClient 需要 Oracle 客户端软件 8.1.7 或更高版本”的问题解决摘要
- 使用tcp_probe时最初没有输出,先卸载后加载模块之后就有了。
- Canvas之打字机游戏
- 【java】之读取InputStream流
- 用c#开发微信 (13) 微统计 - 阅读分享统计系统 3 UI设计及后台处理
- URAL 1205 By the Underground or by Foot?(SPFA)
- Searching in a rotated and sorted array
- JavaScript高级程序设计39.pdf
- [已解决问题] An error occurred while automatically activating bundle com.android.ide.eclipse.adt
- 升级 mysql5.6 配置文件my.cnf sql_mode 解析与设置问题
- flex-骰子布局
- java请求URL带参之防XSS攻击
- MQ &; RPC 消息队列与RPC的区别与使用场景
- HDU3507-Print Article-斜率dp入门题
- 不能靠眼睛之 KEIL 中失效代码灰暗特性
- WEB服务器----Apache 安装配置
- Ubuntu 14.04环境变量修改
- 【Python】Python文件系统功能:os模块