jQuery getAttribute [英] jQuery getAttribute

查看:112
本文介绍了jQuery getAttribute的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个"uid"属性,它在我的"body"标签上的值...

i have an "uid" attribute and it's value on my "body" tag...

$(document).ready(regFunct());

function regFunct(){
   alert($("body").attr("uid"));
}

,但显示未定义".有什么问题吗?

but it says "undefined". something wrong?

推荐答案

尝试:

$(document).ready(function(){ 
     regFunct();
 });

function regFunct(){
     alert($("body").attr("uid"));
 }

这篇关于jQuery getAttribute的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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