Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,471
There are 1746 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     Javascript :

make an element dissapear on click with as little JS as possible

Thread title: make an element dissapear on click with as little JS as possible
Closed Thread    
    Thread tools Search this thread Display Modes  
01-29-2009, 07:34 PM
#1
aLx is offline aLx
Status: Senior Member
Join date: Jan 2006
Location: USA
Expertise:
Software:
 
Posts: 922
iTrader: 13 / 100%
 

aLx is on a distinguished road

Send a message via AIM to aLx

  Old  make an element dissapear on click with as little JS as possible

hey,

I have an <a> element, and I want to make it disappear when clicked. For good. like visibility:none; or whatever.

The only catch is that there will be 100 or so of these on the same page, so the trouble I'm having is finding a GetElementBySelf command or something...

Anyone got a solution?

Thanks,

Cameron

01-30-2009, 11:13 PM
#2
AlexWind is offline AlexWind
Status: Member
Join date: Apr 2008
Location: Florida
Expertise:
Software:
 
Posts: 144
iTrader: 4 / 100%
 

AlexWind is on a distinguished road

Send a message via AIM to AlexWind Send a message via MSN to AlexWind Send a message via Yahoo to AlexWind

  Old

Use Jquery, /the CSS selection on it is great.

03-06-2009, 12:11 AM
#3
Wildhoney is offline Wildhoney
Wildhoney's Avatar
Status: Request a custom title
Join date: Feb 2006
Location: Nottingham
Expertise:
Software:
 
Posts: 1,648
iTrader: 18 / 95%
 

Wildhoney is on a distinguished road

Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney

  Old

You're after: document.getElementsByTagName('a');

03-06-2009, 06:32 PM
#4
semoweb is offline semoweb
semoweb's Avatar
Status: Junior Member
Join date: Mar 2009
Location: California
Expertise:
Software:
 
Posts: 25
iTrader: 0 / 0%
 

semoweb is on a distinguished road

Send a message via Yahoo to semoweb

  Old

Have to agree with him thanks for your share god bless.
Originally Posted by AlexWind View Post
Use Jquery, /the CSS selection on it is great.

03-13-2009, 06:12 AM
#5
rkquest is offline rkquest
rkquest's Avatar
Status: I'm new around here
Join date: Nov 2008
Location:
Expertise:
Software:
 
Posts: 18
iTrader: 0 / 0%
 

rkquest is on a distinguished road

  Old

Try this...

<a onclick="this.style.display='none'" href="#">Click this</a>

Closed Thread    


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed