Try this (untested):
 
$(function() {
   $('.y').html( (new Date).getFullYear() );
});
 
-Mike
 
p.s. Could we avoid profanity on the mailing list? Thanks.


  _____  

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Kristaps Ancans
Sent: Tuesday, December 19, 2006 12:44 AM
To: discuss@jquery.com
Subject: [jQuery] (no subject)


Ok i'm a newbie in jquery and i'm trying to write function that will replace
all <span class="y"><!-- --></span> element's content with current year.
 
My function looks like this:
 
$(function(){
 $(".y").ready(function() {
  var today = new Date();
  var year = today.getFullYear();
  document.write(year);
 });
});

but when i run it - it replaces all the document with current year. In which
place my mistake is ? 
-- 
FYFI - for your fucking information 

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to