jQuery attr 是否允许非标准? [英] Does jQuery attr allow for non standards?

查看:27
本文介绍了jQuery attr 是否允许非标准?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在使用 id 和 title 但我需要再解析 2 位...

I am already using id and title but i need to parse through 2 more bits...

$(this).attr("title"); $(this).attr("id");

$(this).attr("custom1"); 工作吗??

推荐答案

是的,顺便说一句,您可以一次设置多个属性:

yes, and BTW you can set multiple attributes at once:

$('.myselector').attr({
src: 'thefile.gif',
width: 200,
height: 300 });

这篇关于jQuery attr 是否允许非标准?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆