Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Jquery - remove a column!
Old 03-06-2010, 06:14 AM Jquery - remove a column!
kids's Avatar
Ultra Talker

Posts: 301
Trades: 0
Hi all,

I'm starter of jQuery, and I have been created a simple:
Code:
<table>
<tr>
<td id="col1">blablabla</td> <td id="col2">blablabla</td> <td id="col3">blablabla</td>
</tr> </table> <p><span id="remove"><a href="#">Remove</a></span></p>
Please show me the way to remove col 1 when user click "Remove". Thanks
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
kids is offline
Reply With Quote
View Public Profile Visit kids's homepage!
 
 
Register now for full access!
Old 03-06-2010, 09:24 AM Re: Jquery - remove a column!
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
Oddly enough, the method is just called remove()...
Code:
$("#col3").remove();
If you just want to hide it(make it act as if it is gone, but it still remains in the DOM) use the hide() method:
Code:
$("#col3").hide();
If you want to remove the third column, but don't know its ID, you could do it like this:
Code:
$("tr td:nth-child(3)").remove();//1 based
//or:
$("tr td:eq(2)").remove();//zero based
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 03-07-2010, 07:11 AM Re: Jquery - remove a column!
kids's Avatar
Ultra Talker

Posts: 301
Trades: 0
Oh! It's work. Thank you, I don't think it too simple like that!
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
kids is offline
Reply With Quote
View Public Profile Visit kids's homepage!
 
Reply     « Reply to Jquery - remove a column!
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.28092 seconds with 12 queries