xiyueta
v1.2.8
オンラインデモ
> xiyueta().text() 获取匹配全部文本
> xiyueta().html() 获取匹配第一个HTML
> xiyueta().find() 获取匹配元素后代
> xiyueta().add() 追加新的匹配元素
> xiyueta().not() 删除匹配元素
> xiyueta().is() 检测匹配元素
> xiyueta().prop() 检测获得元素属性值
> xiyueta().attr() 第一个元素的属性值
> xiyueta().removeAttr() 删除元素属性
> xiyueta().css() 设置CSS属性
> xiyueta().val() 表单元素的值
> xiyueta().remove() 删除回调一组列表
> xiyueta().each() 遍历匹配元素
> xiyueta().addClass() 类添加到元素中
> xiyueta().hasClass() 搜索元素中类
> xiyueta().removeClass() 移除元素类
> xiyueta().wrap() 包裹到元素周围
> xiyueta().unwrap() 移除元素父元素
> xiyueta().parse() 解析html字符串
> xiyueta().debug() 打印html结构
> xiyueta().print() 打印HTML内容...
Chrome(及同内核的浏览器如QQ浏览器、360浏览器等等),Firefox,Safari,IE 11
npm i xiyueta
または
yarn add xiyueta
const xiyueta = require ( 'xiyueta' ) ;
const $ = xiyueta . load ( '<h2 class="Title">Hello world</h2>' ) ;
$ ( 'h2' ) . text ( 123 ) ;
$ ( 'h2.title' ) . addClass ( 'xyt' ) ;
$ . html ( ) ;
//=> <h2 class="Title xyt">123</h2>
< script src =" https://www.xiyueta.com/js/xiyueta.min.js " > </ script >
< script >
var html = '<span>xiyueta.js</span><span> library</span>' ;
$ . load ( html ) ;
$ . log ( $ ( "span" ) . text ( ) ) ;
//=> xiyueta.js library
</ script >
< script language =" javascript " runat =" server " src =" app/dist/asp.xiyueta.min.js " > </ script >
< %
'这里需要运行一段ASP程序,下面才可以正常运行javascript程序,疑问?'
xiyueta.load(" < title > hello world! </ title > ")
console.log(xiyueta("title").text()) 'ASP里不可以用 $ 直接用 xiyueta代替
'= > hello world!
% >
< script language =" javascript " runat =" server " >
$ . load ( "<title>hello world!</title>" )
console . log ( $ ( "title" ) . text ( ) ) ; //上面要运行一段ASP程序,这里才不会报错,因为要用到ASP程序里的response.write输出函数
//=> hello world!
</ script >
ドキュメント公式ウェブサイト:xiyueta.com/doc/
オンラインデモ:xiyueta.com/demo/
Github リポジトリ: github.com/313801120/xiyueta
Gitee 倉庫: gitee.com/313801120/xiyueta
Gitcode ウェアハウス: gitcode.net/qq313801120/xiyueta
npm ウェアハウス: npmjs.com/package/xiyueta
更新ログ: xiyueta.com/doc/log/
技術交流グループ:以下のQRコードをスキャンしてグループに参加してください