Skip to content

Instantly share code, notes, and snippets.

@saturngod
Created March 3, 2010 08:51
Show Gist options
  • Save saturngod/320449 to your computer and use it in GitHub Desktop.
Save saturngod/320449 to your computer and use it in GitHub Desktop.
//Passing Attribute with jquery 1.4
jQuery('<a/>', {
id: 'foo',
href: 'http://google.com',
title: 'Become a Googler',
rel: 'external',
text: 'Go to Google!'
});
jQuery('<div/>', {
id: 'foo',
css: {
fontWeight: 700,
color: 'green'
},
click: function(){
alert('Foo has been clicked!');
}
});
jQuery('<div/>')
.attr('id', 'foo')
.css({
fontWeight: 700,
color: 'green'
})
.click(function(){
alert('Foo has been clicked!');
});
jQuery('<div/>')
.attr('id', 'foo')
.css({
fontWeight: 700,
color: 'green'
})
.click(function(){
alert('Foo has been clicked!');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment