/    Sign up×
Community /Pin to ProfileBookmark

can somebody explain this to me? i thought it would hide the link within a certain TD but its not working out.

$(‘td a[href=http://www.url.com]’).parent().hide();

to post a comment
CSS

4 Comments(s)

Copy linkTweet thisAlerts:
@3NexJan 13.2012 — You say you want it to hide "the link", not the td? Your selector $('td a[href=http://www.url.com]') captures the link, so you should remove the parent() part of your line.

Also i think you should add quotation marks $('td a[href="http://www.url.com"]')
Copy linkTweet thisAlerts:
@absolutmgd13authorJan 13.2012 — so technically, this should remove that TD than?
Copy linkTweet thisAlerts:
@absolutmgd13authorJan 13.2012 — ah it did.. thanks. im not sure why it wasn't working before. i left it as is, added the quotes and its working out fine now. thanks for your insight!
Copy linkTweet thisAlerts:
@3NexJan 13.2012 — ah it did.. thanks. im not sure why it wasn't working before. i left it as is, added the quotes and its working out fine now. thanks for your insight![/QUOTE]

Well that WAS the reason why it wasn't working before, i told you in the post before that you have to add quotations.

There are also a lot of other rules and ways to select links that just end with a certain string, begin with a certain string or just contain it. You don't always have to specify the whole value of href. Might come in handy when you only want to address, say, local links, https links, links to images, all kinds of crap...
×

Success!

Help @absolutmgd13 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...