setting color of a link in javascript -
i want set color of "val" in link in below code.
var link = $('<a href="#" class="album">' + val + '</a><br><br>');//this link link.style.color="red";//this how iam trying set color of "val"
so how it.
you can this:
link.css({ color: 'red' });
but correct , nice way be:
$(".parent_element").prepend('<a href="#" class="album">'+val+'</a><br><br>'); $(".parent_element > a:first").css({ color: 'red' });
Comments
Post a Comment