I want to create a html link with some styling in it.
right now I'm using:
$('<a/>').text('sample')
.attr('href', 'http://www.google.com/').appendTo('body');
$('a').css({
float: 'right',
fontFamily: 'Verdana, Arial, Helvetica, sans-serif',
position: 'static',
display: 'inline',
visibility: 'inherit'
});
but instead create and refer the tag 2 times, is there are simpler way to do it? like:
$('<a/>').text('sample')
.attr('href', 'http://www.google.com/').appendTo('body');
.css({
float: 'right',
fontFamily: 'Verdana, Arial, Helvetica, sans-serif',
position: 'static',
display: 'inline',
visibility: 'inherit'
});