Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery getAttribute

Tags:

jquery

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?

like image 442
theHack Avatar asked Mar 23 '26 20:03

theHack


1 Answers

try:

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

function regFunct(){
     alert($("body").attr("uid"));
 }
like image 57
TheVillageIdiot Avatar answered Mar 25 '26 09:03

TheVillageIdiot



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!