开发者

Accessing <a> inside div id

im trying to color the 开发者_JAVA百科<a> background color

<div id="contact"><a href="mailto:name@.domain.net>name</a>

with the selector

$('#contact a').css("background", "red");

however im not successfull, where is my error?


you are missing a double quotes in the end of href

see demo http://jsfiddle.net/URJPV/1/


try this one:

<a id="contact_link" href="mailto:name@.domain.net>name</a>

$('a#contact_link').css("background", "red");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜